@ebrains/components 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (649) hide show
  1. package/dist/cjs/clone-846acfdd.js +5 -0
  2. package/dist/cjs/color-primary-palette_6.cjs.entry.js +15 -15
  3. package/dist/cjs/components-section.cjs.entry.js +4 -6
  4. package/dist/cjs/components.cjs.js +2 -2
  5. package/dist/cjs/correct-use-of-colors.cjs.entry.js +2 -2
  6. package/dist/cjs/docs-palettes.cjs.entry.js +2 -2
  7. package/dist/cjs/docs-tokens.cjs.entry.js +2 -2
  8. package/dist/cjs/download-9d17d025.js +20 -0
  9. package/dist/cjs/edit-ff5b84d8.js +5 -0
  10. package/dist/cjs/{eds-avatar_26.cjs.entry.js → eds-accordion_34.cjs.entry.js} +3597 -203
  11. package/dist/cjs/eds-app-root.cjs.entry.js +2 -2
  12. package/dist/cjs/eds-card-desc_2.cjs.entry.js +3 -3
  13. package/dist/cjs/eds-card-generic.cjs.entry.js +1 -1
  14. package/dist/cjs/eds-card-project.cjs.entry.js +2 -2
  15. package/dist/cjs/eds-card-section.cjs.entry.js +1 -1
  16. package/dist/cjs/eds-card-tags.cjs.entry.js +2 -2
  17. package/dist/cjs/eds-card-tool.cjs.entry.js +2 -2
  18. package/dist/cjs/eds-cookies-preference.cjs.entry.js +2 -2
  19. package/dist/cjs/eds-feedback.cjs.entry.js +2 -2
  20. package/dist/cjs/eds-footer.cjs.entry.js +9 -5
  21. package/dist/cjs/eds-frame.cjs.entry.js +2 -2
  22. package/dist/cjs/eds-fullscreen-menu.cjs.entry.js +9 -4
  23. package/dist/cjs/eds-gauge.cjs.entry.js +2 -2
  24. package/dist/cjs/eds-icon-arrow-diagonal.cjs.entry.js +2 -2
  25. package/dist/cjs/eds-icon-arrow-right.cjs.entry.js +2 -2
  26. package/dist/cjs/eds-icon-bin.cjs.entry.js +2 -2
  27. package/dist/cjs/eds-icon-bluesky.cjs.entry.js +2 -2
  28. package/dist/cjs/eds-icon-bookmark.cjs.entry.js +2 -2
  29. package/dist/cjs/eds-icon-chevron-down.cjs.entry.js +2 -2
  30. package/dist/cjs/eds-icon-chevron-left.cjs.entry.js +2 -2
  31. package/dist/cjs/eds-icon-chevron-right.cjs.entry.js +2 -2
  32. package/dist/cjs/eds-icon-chevron-up.cjs.entry.js +2 -2
  33. package/dist/cjs/eds-icon-clone.cjs.entry.js +18 -0
  34. package/dist/cjs/eds-icon-close.cjs.entry.js +2 -2
  35. package/dist/cjs/eds-icon-copy.cjs.entry.js +2 -2
  36. package/dist/cjs/eds-icon-download.cjs.entry.js +18 -0
  37. package/dist/cjs/eds-icon-draft.cjs.entry.js +2 -2
  38. package/dist/cjs/eds-icon-edit.cjs.entry.js +3 -3
  39. package/dist/cjs/eds-icon-eu.cjs.entry.js +2 -2
  40. package/dist/cjs/eds-icon-external.cjs.entry.js +2 -2
  41. package/dist/cjs/eds-icon-facebook.cjs.entry.js +2 -2
  42. package/dist/cjs/eds-icon-gitlab.cjs.entry.js +2 -2
  43. package/dist/cjs/eds-icon-linkedin.cjs.entry.js +2 -2
  44. package/dist/cjs/eds-icon-loader.cjs.entry.js +2 -2
  45. package/dist/cjs/eds-icon-mastodon.cjs.entry.js +2 -2
  46. package/dist/cjs/eds-icon-menu.cjs.entry.js +2 -2
  47. package/dist/cjs/eds-icon-minus.cjs.entry.js +2 -2
  48. package/dist/cjs/eds-icon-more.cjs.entry.js +2 -2
  49. package/dist/cjs/eds-icon-paper.cjs.entry.js +2 -2
  50. package/dist/cjs/eds-icon-plus.cjs.entry.js +2 -2
  51. package/dist/cjs/eds-icon-portal.cjs.entry.js +2 -2
  52. package/dist/cjs/eds-icon-private.cjs.entry.js +2 -2
  53. package/dist/cjs/eds-icon-public.cjs.entry.js +2 -2
  54. package/dist/cjs/eds-icon-search.cjs.entry.js +2 -2
  55. package/dist/cjs/eds-icon-star.cjs.entry.js +2 -2
  56. package/dist/cjs/eds-icon-start.cjs.entry.js +2 -2
  57. package/dist/cjs/eds-icon-success.cjs.entry.js +2 -2
  58. package/dist/cjs/eds-icon-thumbs-down.cjs.entry.js +2 -2
  59. package/dist/cjs/eds-icon-thumbs-up.cjs.entry.js +2 -2
  60. package/dist/cjs/eds-icon-tutorial.cjs.entry.js +2 -2
  61. package/dist/cjs/eds-icon-twitter.cjs.entry.js +2 -2
  62. package/dist/cjs/eds-icon-unknown.cjs.entry.js +2 -2
  63. package/dist/cjs/eds-icon-updown.cjs.entry.js +2 -2
  64. package/dist/cjs/eds-icon-user.cjs.entry.js +2 -2
  65. package/dist/cjs/eds-icon-view.cjs.entry.js +18 -0
  66. package/dist/cjs/eds-icon-youtube.cjs.entry.js +2 -2
  67. package/dist/cjs/eds-modal.cjs.entry.js +3 -3
  68. package/dist/cjs/eds-pie.cjs.entry.js +1 -1
  69. package/dist/cjs/eds-progress-bar.cjs.entry.js +2 -2
  70. package/dist/cjs/eds-section-core_2.cjs.entry.js +4 -4
  71. package/dist/cjs/eds-social-networks.cjs.entry.js +3 -5
  72. package/dist/cjs/eds-spinner.cjs.entry.js +2 -2
  73. package/dist/cjs/eds-splash-screen.cjs.entry.js +1 -1
  74. package/dist/cjs/eds-timeline.cjs.entry.js +2 -2
  75. package/dist/cjs/eds-toast-manager.cjs.entry.js +2 -2
  76. package/dist/cjs/eds-trl.cjs.entry.js +2 -2
  77. package/dist/cjs/incorrect-use-of-colors.cjs.entry.js +2 -2
  78. package/dist/cjs/{index-88c8039f.js → index-0249a32e.js} +19 -32
  79. package/dist/cjs/loader.cjs.js +2 -2
  80. package/dist/cjs/logo-space.cjs.entry.js +2 -2
  81. package/dist/cjs/logo-variations-horizontal_2.cjs.entry.js +3 -3
  82. package/dist/cjs/logo-variations-tabs.cjs.entry.js +2 -2
  83. package/dist/cjs/logo-wrong-usage.cjs.entry.js +2 -2
  84. package/dist/cjs/svg-repository.cjs.entry.js +10 -22
  85. package/dist/cjs/token-list_3.cjs.entry.js +4 -4
  86. package/dist/cjs/token-ratios.cjs.entry.js +2 -2
  87. package/dist/cjs/token-spacing.cjs.entry.js +2 -2
  88. package/dist/cjs/token-typography.cjs.entry.js +2 -2
  89. package/dist/cjs/view-80d5c6c8.js +5 -0
  90. package/dist/collection/collection-manifest.json +4 -0
  91. package/dist/collection/components/eds-accordion/eds-accordion.js +1 -1
  92. package/dist/collection/components/eds-alert/eds-alert.js +30 -3
  93. package/dist/collection/components/eds-avatar/eds-avatar.js +1 -1
  94. package/dist/collection/components/eds-block-break/eds-block-break.js +1 -1
  95. package/dist/collection/components/eds-breadcrump/eds-breadcrump.js +1 -1
  96. package/dist/collection/components/eds-button/eds-button.css +4 -0
  97. package/dist/collection/components/eds-button/eds-button.js +19 -8
  98. package/dist/collection/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.js +1 -1
  99. package/dist/collection/components/eds-cards/eds-card-composer/eds-card-tags/eds-card-tags.js +1 -1
  100. package/dist/collection/components/eds-cards/eds-card-composer/eds-card-title/eds-card-title.js +1 -1
  101. package/dist/collection/components/eds-cards/eds-card-project/eds-card-project.js +1 -1
  102. package/dist/collection/components/eds-cards/eds-card-tool/eds-card-tool.js +1 -1
  103. package/dist/collection/components/eds-charts/eds-gauge/eds-gauge.js +1 -1
  104. package/dist/collection/components/eds-code-block/eds-code-block.js +1 -1
  105. package/dist/collection/components/eds-dropdown/eds-dropdown.js +2 -2
  106. package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-down/eds-icon-chevron-down.js +1 -1
  107. package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-left/eds-icon-chevron-left.js +1 -1
  108. package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-right/eds-icon-chevron-right.js +1 -1
  109. package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-up/eds-icon-chevron-up.js +1 -1
  110. package/dist/collection/components/eds-icons/eds-icon-arrow-diagonal/eds-icon-arrow-diagonal.js +1 -1
  111. package/dist/collection/components/eds-icons/eds-icon-arrow-right/eds-icon-arrow-right.js +1 -1
  112. package/dist/collection/components/eds-icons/eds-icon-bin/eds-icon-bin.js +1 -1
  113. package/dist/collection/components/eds-icons/eds-icon-bookmark/eds-icon-bookmark.js +1 -1
  114. package/dist/collection/components/eds-icons/eds-icon-clone/eds-icon-clone.js +36 -0
  115. package/dist/collection/components/eds-icons/eds-icon-close/eds-icon-close.js +1 -1
  116. package/dist/collection/components/eds-icons/eds-icon-copy/eds-icon-copy.js +1 -1
  117. package/dist/collection/components/eds-icons/eds-icon-download/eds-icon-download.js +36 -0
  118. package/dist/collection/components/eds-icons/eds-icon-draft/eds-icon-draft.js +1 -1
  119. package/dist/collection/components/eds-icons/eds-icon-edit/eds-icon-edit.js +1 -1
  120. package/dist/collection/components/eds-icons/eds-icon-eu/eds-icon-eu.js +1 -1
  121. package/dist/collection/components/eds-icons/eds-icon-external/eds-icon-external.js +1 -1
  122. package/dist/collection/components/eds-icons/eds-icon-gitlab/eds-icon-gitlab.js +1 -1
  123. package/dist/collection/components/eds-icons/eds-icon-loader/eds-icon-loader.js +1 -1
  124. package/dist/collection/components/eds-icons/eds-icon-menu/eds-icon-menu.js +1 -1
  125. package/dist/collection/components/eds-icons/eds-icon-minus/eds-icon-minus.js +1 -1
  126. package/dist/collection/components/eds-icons/eds-icon-more/eds-icon-more.js +1 -1
  127. package/dist/collection/components/eds-icons/eds-icon-paper/eds-icon-paper.js +1 -1
  128. package/dist/collection/components/eds-icons/eds-icon-plus/eds-icon-plus.js +1 -1
  129. package/dist/collection/components/eds-icons/eds-icon-portal/eds-icon-portal.js +1 -1
  130. package/dist/collection/components/eds-icons/eds-icon-private/eds-icon-private.js +1 -1
  131. package/dist/collection/components/eds-icons/eds-icon-public/eds-icon-public.js +1 -1
  132. package/dist/collection/components/eds-icons/eds-icon-search/eds-icon-search.js +1 -1
  133. package/dist/collection/components/eds-icons/eds-icon-star/eds-icon-star.js +1 -1
  134. package/dist/collection/components/eds-icons/eds-icon-start/eds-icon-start.js +1 -1
  135. package/dist/collection/components/eds-icons/eds-icon-success/eds-icon-success.js +1 -1
  136. package/dist/collection/components/eds-icons/eds-icon-thumbs-down/eds-icon-thumbs-down.js +1 -1
  137. package/dist/collection/components/eds-icons/eds-icon-thumbs-up/eds-icon-thumbs-up.js +1 -1
  138. package/dist/collection/components/eds-icons/eds-icon-tutorial/eds-icon-tutorial.js +1 -1
  139. package/dist/collection/components/eds-icons/eds-icon-unknown/eds-icon-unknown.js +1 -1
  140. package/dist/collection/components/eds-icons/eds-icon-updown/eds-icon-updown.js +1 -1
  141. package/dist/collection/components/eds-icons/eds-icon-user/eds-icon-user.js +1 -1
  142. package/dist/collection/components/eds-icons/eds-icon-view/eds-icon-view.js +36 -0
  143. package/dist/collection/components/eds-icons/social/eds-icon-bluesky/eds-icon-bluesky.js +1 -1
  144. package/dist/collection/components/eds-icons/social/eds-icon-facebook/eds-icon-facebook.js +1 -1
  145. package/dist/collection/components/eds-icons/social/eds-icon-linkedin/eds-icon-linkedin.js +1 -1
  146. package/dist/collection/components/eds-icons/social/eds-icon-mastodon/eds-icon-mastodon.js +1 -1
  147. package/dist/collection/components/eds-icons/social/eds-icon-twitter/eds-icon-twitter.js +1 -1
  148. package/dist/collection/components/eds-icons/social/eds-icon-youtube/eds-icon-youtube.js +1 -1
  149. package/dist/collection/components/eds-img/eds-img.js +2 -2
  150. package/dist/collection/components/eds-input-elements/eds-input/eds-input.js +2 -2
  151. package/dist/collection/components/eds-input-elements/eds-input-footer/eds-input-footer.js +1 -1
  152. package/dist/collection/components/eds-input-elements/eds-input-label/eds-input-label.js +1 -1
  153. package/dist/collection/components/eds-input-elements/eds-input-range/eds-input-range.js +1 -1
  154. package/dist/collection/components/eds-input-elements/eds-input-search/eds-input-search.js +1 -1
  155. package/dist/collection/components/eds-input-elements/eds-input-select/eds-input-select.js +2 -2
  156. package/dist/collection/components/eds-input-field/eds-input-field.js +3 -2
  157. package/dist/collection/components/eds-link/eds-link.js +27 -7
  158. package/dist/collection/components/eds-link/eds-link.stories.js +3 -1
  159. package/dist/collection/components/eds-logo/eds-logo.js +1 -1
  160. package/dist/collection/components/eds-modal/eds-modal.js +2 -2
  161. package/dist/collection/components/eds-nps/eds-npm.stories.js +36 -0
  162. package/dist/collection/components/eds-nps/eds-nps.css +73 -0
  163. package/dist/collection/components/eds-nps/eds-nps.js +163 -0
  164. package/dist/collection/components/eds-pagination/eds-pagination.css +16 -0
  165. package/dist/collection/components/eds-pagination/eds-pagination.js +131 -51
  166. package/dist/collection/components/eds-progress-bar/eds-progress-bar.js +1 -1
  167. package/dist/collection/components/eds-rating/eds-rating.js +25 -3
  168. package/dist/collection/components/eds-section/eds-section-core/eds-section-core.js +1 -1
  169. package/dist/collection/components/eds-section/eds-section-heading/eds-section-heading.js +2 -2
  170. package/dist/collection/components/eds-spinner/eds-spinner.js +1 -1
  171. package/dist/collection/components/eds-switch/eds-switch.css +15 -5
  172. package/dist/collection/components/eds-switch/eds-switch.js +26 -4
  173. package/dist/collection/components/eds-table/eds-table.css +4 -0
  174. package/dist/collection/components/eds-table/eds-table.js +42 -39
  175. package/dist/collection/components/eds-table/eds-table.stories.js +1 -1
  176. package/dist/collection/components/eds-tag/eds-tag.js +1 -1
  177. package/dist/collection/components/eds-timeline/eds-timeline.js +1 -1
  178. package/dist/collection/components/eds-tooltip/eds-tooltip.css +5 -0
  179. package/dist/collection/components/eds-tooltip/eds-tooltip.js +2 -2
  180. package/dist/collection/components/eds-trl/eds-trl.js +1 -1
  181. package/dist/collection/eds-docs-ui/colors/color-palette/primary.js +1 -1
  182. package/dist/collection/eds-docs-ui/colors/color-palette/secondary.js +1 -1
  183. package/dist/collection/eds-docs-ui/colors/color-palette/support.js +1 -1
  184. package/dist/collection/eds-docs-ui/colors/gradient-palette/primary.js +1 -1
  185. package/dist/collection/eds-docs-ui/colors/gradient-palette/secondary.js +7 -7
  186. package/dist/collection/eds-docs-ui/colors/gradient-palette/support.js +3 -3
  187. package/dist/collection/eds-docs-ui/colors/use-of-colors/correct-use-of-colors.js +1 -1
  188. package/dist/collection/eds-docs-ui/colors/use-of-colors/incorrect-use-of-colors.js +1 -1
  189. package/dist/collection/eds-docs-ui/components-section/components-section.js +1 -1
  190. package/dist/collection/eds-docs-ui/components-section/functional/overview.js +1 -1
  191. package/dist/collection/eds-docs-ui/design-tokens/docs-tokens/docs-tokens.js +1 -1
  192. package/dist/collection/eds-docs-ui/design-tokens/token-list/token-list.js +1 -1
  193. package/dist/collection/eds-docs-ui/design-tokens/token-radii/token-radii.js +1 -1
  194. package/dist/collection/eds-docs-ui/design-tokens/token-ratios/token-ratios.js +1 -1
  195. package/dist/collection/eds-docs-ui/design-tokens/token-shadows/token-shadows.js +1 -1
  196. package/dist/collection/eds-docs-ui/design-tokens/token-spacing/token-spacing.js +1 -1
  197. package/dist/collection/eds-docs-ui/design-tokens/token-typography/token-typography.js +1 -1
  198. package/dist/collection/eds-docs-ui/docs-palettes/docs-palettes.js +1 -1
  199. package/dist/collection/eds-docs-ui/logo/logo-space/logo-space.js +1 -1
  200. package/dist/collection/eds-docs-ui/logo/logo-variations/horizontal/logo-variations-horizontal.js +1 -1
  201. package/dist/collection/eds-docs-ui/logo/logo-variations/vertical/logo-variations-vertical.js +1 -1
  202. package/dist/collection/eds-docs-ui/logo/logo-variations-tabs/logo-variations.js +1 -1
  203. package/dist/collection/eds-docs-ui/logo/logo-wrong-usage/logo-wrong-usage.js +1 -1
  204. package/dist/collection/eds-docs-ui/svg-repository/svg-repository.js +1 -1
  205. package/dist/collection/shared-ui/eds-cookies-preference/eds-cookies-preference.js +1 -1
  206. package/dist/collection/shared-ui/eds-feedback/eds-feedback.js +1 -1
  207. package/dist/collection/shared-ui/eds-footer/eds-footer.js +13 -6
  208. package/dist/collection/shared-ui/eds-form/eds-form.css +72 -0
  209. package/dist/collection/shared-ui/eds-form/eds-form.js +110 -5
  210. package/dist/collection/shared-ui/eds-form/eds-form.stories.js +33 -4
  211. package/dist/collection/shared-ui/eds-frame/eds-frame.js +1 -1
  212. package/dist/collection/shared-ui/eds-fullscreen-menu/eds-fullscreen-menu.js +50 -16
  213. package/dist/collection/shared-ui/eds-header/eds-header.js +1 -1
  214. package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.js +20 -8
  215. package/dist/collection/shared-ui/eds-social-networks/eds-social-networks.css +0 -20
  216. package/dist/collection/shared-ui/eds-social-networks/eds-social-networks.js +1 -3
  217. package/dist/collection/shared-ui/eds-social-networks/eds-social-networks.stories.js +6 -7
  218. package/dist/collection/shared-ui/eds-steps/eds-steps.css +136 -92
  219. package/dist/collection/shared-ui/eds-steps/eds-steps.js +234 -40
  220. package/dist/collection/shared-ui/eds-steps/eds-steps.stories.js +71 -7
  221. package/dist/collection/shared-ui/eds-steps-v2/eds-steps-v2.css +44 -33
  222. package/dist/collection/shared-ui/eds-steps-v2/eds-steps-v2.js +195 -19
  223. package/dist/collection/shared-ui/eds-steps-v2/eds-steps-v2.stories.js +65 -4
  224. package/dist/collection/shared-ui/eds-tabs/eds-tabs.css +26 -5
  225. package/dist/collection/shared-ui/eds-tabs/eds-tabs.js +89 -31
  226. package/dist/collection/shared-ui/eds-toast-manager/eds-toast-manager.js +1 -1
  227. package/dist/collection/shared-ui/eds-user/eds-user.js +35 -1
  228. package/dist/collection/shared-ui/examples/eds-app-root/eds-app-root.js +1 -1
  229. package/dist/collection/utils/eds-form/formValidators.js +34 -0
  230. package/dist/components/clone.js +3 -0
  231. package/dist/components/components-section.js +3 -5
  232. package/dist/components/components.css +7 -12
  233. package/dist/components/components.esm.js +1 -1
  234. package/dist/components/correct-use-of-colors.js +1 -1
  235. package/dist/components/docs-palettes.js +1 -1
  236. package/dist/components/docs-tokens.js +1 -1
  237. package/dist/components/download.js +18 -0
  238. package/dist/components/edit.js +1 -1
  239. package/dist/components/eds-accordion2.js +1 -1
  240. package/dist/components/eds-alert2.js +21 -5
  241. package/dist/components/eds-app-root.js +1 -1
  242. package/dist/components/eds-avatar2.js +1 -1
  243. package/dist/components/eds-block-break2.js +1 -1
  244. package/dist/components/eds-breadcrumb.js +1 -1
  245. package/dist/components/eds-button2.js +21 -10
  246. package/dist/components/eds-card-desc2.js +1 -1
  247. package/dist/components/eds-card-project.js +1 -1
  248. package/dist/components/eds-card-tags.js +1 -1
  249. package/dist/components/eds-card-title2.js +1 -1
  250. package/dist/components/eds-card-tool.js +1 -1
  251. package/dist/components/eds-code-block2.js +1 -1
  252. package/dist/components/eds-cookies-preference.js +1 -1
  253. package/dist/components/eds-dropdown2.js +2 -2
  254. package/dist/components/eds-feedback.js +1 -1
  255. package/dist/components/eds-footer2.js +8 -4
  256. package/dist/components/eds-form.js +100 -24
  257. package/dist/components/eds-frame.js +1 -1
  258. package/dist/components/eds-fullscreen-menu.js +8 -3
  259. package/dist/components/eds-gauge.js +1 -1
  260. package/dist/components/eds-header.js +1 -1
  261. package/dist/components/eds-icon-arrow-diagonal.js +1 -1
  262. package/dist/components/eds-icon-arrow-right.js +1 -1
  263. package/dist/components/eds-icon-bin.js +1 -1
  264. package/dist/components/eds-icon-bluesky.js +1 -1
  265. package/dist/components/eds-icon-bookmark.js +1 -1
  266. package/dist/components/eds-icon-chevron-down.js +1 -1
  267. package/dist/components/eds-icon-chevron-left.js +1 -1
  268. package/dist/components/eds-icon-chevron-right.js +1 -1
  269. package/dist/components/eds-icon-chevron-up.js +1 -1
  270. package/dist/components/eds-icon-clone.d.ts +11 -0
  271. package/dist/components/eds-icon-clone.js +33 -0
  272. package/dist/components/eds-icon-close.js +1 -1
  273. package/dist/components/eds-icon-copy.js +1 -1
  274. package/dist/components/eds-icon-download.d.ts +11 -0
  275. package/dist/components/eds-icon-download.js +33 -0
  276. package/dist/components/eds-icon-draft.js +1 -1
  277. package/dist/components/eds-icon-edit.js +1 -1
  278. package/dist/components/eds-icon-eu.js +1 -1
  279. package/dist/components/eds-icon-external.js +1 -1
  280. package/dist/components/eds-icon-facebook.js +1 -1
  281. package/dist/components/eds-icon-gitlab.js +1 -1
  282. package/dist/components/eds-icon-linkedin.js +1 -1
  283. package/dist/components/eds-icon-loader.js +1 -1
  284. package/dist/components/eds-icon-mastodon.js +1 -1
  285. package/dist/components/eds-icon-menu.js +1 -1
  286. package/dist/components/eds-icon-minus.js +1 -1
  287. package/dist/components/eds-icon-more.js +1 -1
  288. package/dist/components/eds-icon-paper.js +1 -1
  289. package/dist/components/eds-icon-plus.js +1 -1
  290. package/dist/components/eds-icon-portal.js +1 -1
  291. package/dist/components/eds-icon-private.js +1 -1
  292. package/dist/components/eds-icon-public.js +1 -1
  293. package/dist/components/eds-icon-search.js +1 -1
  294. package/dist/components/eds-icon-star.js +1 -1
  295. package/dist/components/eds-icon-start.js +1 -1
  296. package/dist/components/eds-icon-success.js +1 -1
  297. package/dist/components/eds-icon-thumbs-down.js +1 -1
  298. package/dist/components/eds-icon-thumbs-up.js +1 -1
  299. package/dist/components/eds-icon-tutorial.js +1 -1
  300. package/dist/components/eds-icon-twitter.js +1 -1
  301. package/dist/components/eds-icon-unknown.js +1 -1
  302. package/dist/components/eds-icon-updown.js +1 -1
  303. package/dist/components/eds-icon-user.js +1 -1
  304. package/dist/components/eds-icon-view.d.ts +11 -0
  305. package/dist/components/eds-icon-view.js +33 -0
  306. package/dist/components/eds-icon-youtube.js +1 -1
  307. package/dist/components/eds-img2.js +2 -2
  308. package/dist/components/eds-input-field2.js +4 -3
  309. package/dist/components/eds-input-footer2.js +1 -1
  310. package/dist/components/eds-input-label2.js +1 -1
  311. package/dist/components/eds-input-range2.js +1 -1
  312. package/dist/components/eds-input-search2.js +1 -1
  313. package/dist/components/eds-input-select2.js +2 -2
  314. package/dist/components/eds-input2.js +2 -2
  315. package/dist/components/eds-link2.js +27 -7
  316. package/dist/components/eds-logo2.js +1 -1
  317. package/dist/components/eds-modal.js +2 -2
  318. package/dist/components/eds-nps.d.ts +11 -0
  319. package/dist/components/eds-nps.js +6 -0
  320. package/dist/components/eds-nps2.js +120 -0
  321. package/dist/components/eds-pagination2.js +120 -53
  322. package/dist/components/eds-progress-bar2.js +1 -1
  323. package/dist/components/eds-rating2.js +25 -3
  324. package/dist/components/eds-section-core2.js +1 -1
  325. package/dist/components/eds-section-heading2.js +2 -2
  326. package/dist/components/eds-social-networks2.js +2 -4
  327. package/dist/components/eds-spinner2.js +1 -1
  328. package/dist/components/eds-steps-v2.js +35 -13
  329. package/dist/components/eds-steps2.js +54 -35
  330. package/dist/components/eds-switch.js +27 -5
  331. package/dist/components/eds-table2.js +74 -41
  332. package/dist/components/eds-tabs.js +90 -32
  333. package/dist/components/eds-tag2.js +1 -1
  334. package/dist/components/eds-timeline.js +1 -1
  335. package/dist/components/eds-toast-manager.js +1 -1
  336. package/dist/components/eds-tooltip.js +1 -50
  337. package/dist/components/eds-tooltip2.js +52 -0
  338. package/dist/components/eds-trl.js +37 -25
  339. package/dist/components/eds-user.js +12 -10
  340. package/dist/components/incorrect-use-of-colors.js +9 -3
  341. package/dist/components/logo-space.js +35 -23
  342. package/dist/components/logo-variations-horizontal2.js +1 -1
  343. package/dist/components/logo-variations-tabs.js +1 -1
  344. package/dist/components/logo-variations-vertical2.js +1 -1
  345. package/dist/components/logo-wrong-usage.js +1 -1
  346. package/dist/components/p-0452fe52.entry.js +1 -0
  347. package/dist/components/p-04f288b1.entry.js +1 -0
  348. package/dist/components/p-06951aa3.entry.js +1 -0
  349. package/dist/components/p-0da7d1c9.js +1 -0
  350. package/dist/components/p-101392d0.entry.js +1 -0
  351. package/dist/components/{p-ed4d9bf5.entry.js → p-171f8e6b.entry.js} +1 -1
  352. package/dist/components/p-19e69c03.entry.js +1 -0
  353. package/dist/components/{p-e2e7250a.entry.js → p-1b032aa8.entry.js} +1 -1
  354. package/dist/components/{p-adbd0d7b.entry.js → p-265150a1.entry.js} +1 -1
  355. package/dist/components/p-27c4a06e.js +1 -0
  356. package/dist/components/p-28ec52a7.entry.js +1 -0
  357. package/dist/components/p-2f712656.entry.js +1 -0
  358. package/dist/components/p-3097c321.entry.js +1 -0
  359. package/dist/components/p-36db7db0.entry.js +1 -0
  360. package/dist/components/p-38b0ea8d.entry.js +1 -0
  361. package/dist/components/p-3b551ade.entry.js +9 -0
  362. package/dist/components/p-3fa4a703.entry.js +1 -0
  363. package/dist/components/p-3fa54526.entry.js +1 -0
  364. package/dist/components/p-42680319.entry.js +1 -0
  365. package/dist/components/{p-6d3b5818.entry.js → p-4c618a35.entry.js} +1 -1
  366. package/dist/components/p-4d207d0e.entry.js +1 -0
  367. package/dist/components/p-4db384d9.entry.js +1 -0
  368. package/dist/components/p-4eb2cf7f.js +1 -0
  369. package/dist/components/{p-70e8e66f.entry.js → p-50d7eed9.entry.js} +1 -1
  370. package/dist/components/p-5367bb59.entry.js +1 -0
  371. package/dist/components/{p-356846cd.entry.js → p-5479e43b.entry.js} +1 -1
  372. package/dist/components/{p-3e183368.entry.js → p-58c8c0d7.entry.js} +1 -1
  373. package/dist/components/p-5a88cdc2.entry.js +1 -0
  374. package/dist/components/p-5b574bb2.entry.js +1 -0
  375. package/dist/components/p-5ec9fc29.entry.js +1 -0
  376. package/dist/components/p-5f350866.entry.js +1 -0
  377. package/dist/components/p-5ff10b6f.entry.js +1 -0
  378. package/dist/components/p-6420754e.entry.js +1 -0
  379. package/dist/components/{p-b073d78f.entry.js → p-64b7a6fc.entry.js} +1 -1
  380. package/dist/components/{p-02d94d2d.entry.js → p-6614881d.entry.js} +1 -1
  381. package/dist/components/p-68a2cd95.entry.js +1 -0
  382. package/dist/components/{p-f6ca2aa6.entry.js → p-6a2d1e11.entry.js} +1 -1
  383. package/dist/components/p-6b988c76.entry.js +1 -0
  384. package/dist/components/p-7032a73b.entry.js +1 -0
  385. package/dist/components/p-7272628d.entry.js +1 -0
  386. package/dist/components/p-78c348e2.entry.js +1 -0
  387. package/dist/components/{p-8c0b0121.entry.js → p-79afd8aa.entry.js} +1 -1
  388. package/dist/components/p-7a5623b5.entry.js +1 -0
  389. package/dist/components/p-7fa46b01.entry.js +1 -0
  390. package/dist/components/p-86eff0cb.entry.js +1 -0
  391. package/dist/components/p-870001ee.entry.js +1 -0
  392. package/dist/components/p-88eeaeca.entry.js +1 -0
  393. package/dist/components/p-8b7910d2.entry.js +1 -0
  394. package/dist/components/p-8cf98230.entry.js +1 -0
  395. package/dist/components/{p-e35e156d.entry.js → p-8eced026.entry.js} +1 -1
  396. package/dist/components/{p-0687532c.entry.js → p-8edd07db.entry.js} +1 -1
  397. package/dist/components/p-8ef68d8a.entry.js +1 -0
  398. package/dist/components/p-8fb1eb43.entry.js +1 -0
  399. package/dist/components/p-9261d27c.entry.js +1 -0
  400. package/dist/components/{p-9d18d7b1.entry.js → p-94a223ec.entry.js} +1 -1
  401. package/dist/components/{p-1f5c19b9.entry.js → p-9c1c5e8d.entry.js} +1 -1
  402. package/dist/components/p-9cb14b1f.entry.js +1 -0
  403. package/dist/components/{p-024789cc.entry.js → p-a5fd4fc9.entry.js} +1 -1
  404. package/dist/components/p-a6586448.entry.js +1 -0
  405. package/dist/components/p-ad7d603b.entry.js +1 -0
  406. package/dist/components/p-b24ef7f7.entry.js +1 -0
  407. package/dist/components/{p-66f4cdd9.entry.js → p-b31babda.entry.js} +1 -1
  408. package/dist/components/p-baa2df0b.entry.js +1 -0
  409. package/dist/components/p-bfe9d934.entry.js +1 -0
  410. package/dist/components/p-c1943b8f.entry.js +1 -0
  411. package/dist/components/{p-b3a40663.entry.js → p-c66f4dd8.entry.js} +1 -1
  412. package/dist/components/{p-4e473b4e.entry.js → p-d1927da7.entry.js} +1 -1
  413. package/dist/components/{p-543f2347.entry.js → p-d2e485a1.entry.js} +1 -1
  414. package/dist/components/{p-794f11e7.entry.js → p-d3391236.entry.js} +1 -1
  415. package/dist/components/p-da0e9a75.entry.js +1 -0
  416. package/dist/components/p-dbe11048.entry.js +1 -0
  417. package/dist/components/{p-773a119a.entry.js → p-dd28ab38.entry.js} +1 -1
  418. package/dist/components/p-e42ac312.entry.js +1 -0
  419. package/dist/components/p-e6c3f38c.entry.js +1 -0
  420. package/dist/components/p-e7c37e5b.entry.js +1 -0
  421. package/dist/components/p-e8374410.entry.js +1 -0
  422. package/dist/components/p-e90da4ba.entry.js +1 -0
  423. package/dist/components/p-e9cd3c4b.entry.js +1 -0
  424. package/dist/components/p-ebd59113.entry.js +1 -0
  425. package/dist/components/{p-28ae3f3a.js → p-efbc374c.js} +2 -2
  426. package/dist/components/p-f092b706.entry.js +1 -0
  427. package/dist/components/p-f29e7506.entry.js +1 -0
  428. package/dist/components/p-f2abe4d8.js +1 -0
  429. package/dist/components/p-f40dd50d.entry.js +1 -0
  430. package/dist/components/p-fc099d59.entry.js +1 -0
  431. package/dist/components/p-fda3da92.entry.js +1 -0
  432. package/dist/components/{p-2839899a.entry.js → p-ff902c98.entry.js} +1 -1
  433. package/dist/components/primary.js +1 -1
  434. package/dist/components/primary2.js +1 -1
  435. package/dist/components/secondary.js +1 -1
  436. package/dist/components/secondary2.js +7 -7
  437. package/dist/components/support.js +1 -1
  438. package/dist/components/support2.js +3 -3
  439. package/dist/components/svg-repository.js +41 -41
  440. package/dist/components/token-list2.js +1 -1
  441. package/dist/components/token-radii2.js +1 -1
  442. package/dist/components/token-ratios.js +1 -1
  443. package/dist/components/token-shadows2.js +1 -1
  444. package/dist/components/token-spacing.js +1 -1
  445. package/dist/components/token-typography.js +1 -1
  446. package/dist/components/view.js +3 -0
  447. package/dist/esm/clone-dab56639.js +3 -0
  448. package/dist/esm/color-primary-palette_6.entry.js +15 -15
  449. package/dist/esm/components-section.entry.js +4 -6
  450. package/dist/esm/components.js +3 -3
  451. package/dist/esm/correct-use-of-colors.entry.js +2 -2
  452. package/dist/esm/docs-palettes.entry.js +2 -2
  453. package/dist/esm/docs-tokens.entry.js +2 -2
  454. package/dist/esm/download-47746956.js +18 -0
  455. package/dist/esm/edit-3893a517.js +3 -0
  456. package/dist/esm/{eds-avatar_26.entry.js → eds-accordion_34.entry.js} +3591 -205
  457. package/dist/esm/eds-app-root.entry.js +2 -2
  458. package/dist/esm/eds-card-desc_2.entry.js +3 -3
  459. package/dist/esm/eds-card-generic.entry.js +1 -1
  460. package/dist/esm/eds-card-project.entry.js +2 -2
  461. package/dist/esm/eds-card-section.entry.js +1 -1
  462. package/dist/esm/eds-card-tags.entry.js +2 -2
  463. package/dist/esm/eds-card-tool.entry.js +2 -2
  464. package/dist/esm/eds-cookies-preference.entry.js +2 -2
  465. package/dist/esm/eds-feedback.entry.js +2 -2
  466. package/dist/esm/eds-footer.entry.js +9 -5
  467. package/dist/esm/eds-frame.entry.js +2 -2
  468. package/dist/esm/eds-fullscreen-menu.entry.js +9 -4
  469. package/dist/esm/eds-gauge.entry.js +2 -2
  470. package/dist/esm/eds-icon-arrow-diagonal.entry.js +2 -2
  471. package/dist/esm/eds-icon-arrow-right.entry.js +2 -2
  472. package/dist/esm/eds-icon-bin.entry.js +2 -2
  473. package/dist/esm/eds-icon-bluesky.entry.js +2 -2
  474. package/dist/esm/eds-icon-bookmark.entry.js +2 -2
  475. package/dist/esm/eds-icon-chevron-down.entry.js +2 -2
  476. package/dist/esm/eds-icon-chevron-left.entry.js +2 -2
  477. package/dist/esm/eds-icon-chevron-right.entry.js +2 -2
  478. package/dist/esm/eds-icon-chevron-up.entry.js +2 -2
  479. package/dist/esm/eds-icon-clone.entry.js +14 -0
  480. package/dist/esm/eds-icon-close.entry.js +2 -2
  481. package/dist/esm/eds-icon-copy.entry.js +2 -2
  482. package/dist/esm/eds-icon-download.entry.js +14 -0
  483. package/dist/esm/eds-icon-draft.entry.js +2 -2
  484. package/dist/esm/eds-icon-edit.entry.js +3 -3
  485. package/dist/esm/eds-icon-eu.entry.js +2 -2
  486. package/dist/esm/eds-icon-external.entry.js +2 -2
  487. package/dist/esm/eds-icon-facebook.entry.js +2 -2
  488. package/dist/esm/eds-icon-gitlab.entry.js +2 -2
  489. package/dist/esm/eds-icon-linkedin.entry.js +2 -2
  490. package/dist/esm/eds-icon-loader.entry.js +2 -2
  491. package/dist/esm/eds-icon-mastodon.entry.js +2 -2
  492. package/dist/esm/eds-icon-menu.entry.js +2 -2
  493. package/dist/esm/eds-icon-minus.entry.js +2 -2
  494. package/dist/esm/eds-icon-more.entry.js +2 -2
  495. package/dist/esm/eds-icon-paper.entry.js +2 -2
  496. package/dist/esm/eds-icon-plus.entry.js +2 -2
  497. package/dist/esm/eds-icon-portal.entry.js +2 -2
  498. package/dist/esm/eds-icon-private.entry.js +2 -2
  499. package/dist/esm/eds-icon-public.entry.js +2 -2
  500. package/dist/esm/eds-icon-search.entry.js +2 -2
  501. package/dist/esm/eds-icon-star.entry.js +2 -2
  502. package/dist/esm/eds-icon-start.entry.js +2 -2
  503. package/dist/esm/eds-icon-success.entry.js +2 -2
  504. package/dist/esm/eds-icon-thumbs-down.entry.js +2 -2
  505. package/dist/esm/eds-icon-thumbs-up.entry.js +2 -2
  506. package/dist/esm/eds-icon-tutorial.entry.js +2 -2
  507. package/dist/esm/eds-icon-twitter.entry.js +2 -2
  508. package/dist/esm/eds-icon-unknown.entry.js +2 -2
  509. package/dist/esm/eds-icon-updown.entry.js +2 -2
  510. package/dist/esm/eds-icon-user.entry.js +2 -2
  511. package/dist/esm/eds-icon-view.entry.js +14 -0
  512. package/dist/esm/eds-icon-youtube.entry.js +2 -2
  513. package/dist/esm/eds-modal.entry.js +3 -3
  514. package/dist/esm/eds-pie.entry.js +1 -1
  515. package/dist/esm/eds-progress-bar.entry.js +2 -2
  516. package/dist/esm/eds-section-core_2.entry.js +4 -4
  517. package/dist/esm/eds-social-networks.entry.js +3 -5
  518. package/dist/esm/eds-spinner.entry.js +2 -2
  519. package/dist/esm/eds-splash-screen.entry.js +1 -1
  520. package/dist/esm/eds-timeline.entry.js +2 -2
  521. package/dist/esm/eds-toast-manager.entry.js +2 -2
  522. package/dist/esm/eds-trl.entry.js +2 -2
  523. package/dist/esm/incorrect-use-of-colors.entry.js +2 -2
  524. package/dist/esm/{index-fdb33359.js → index-e84b871c.js} +19 -32
  525. package/dist/esm/loader.js +3 -3
  526. package/dist/esm/logo-space.entry.js +2 -2
  527. package/dist/esm/logo-variations-horizontal_2.entry.js +3 -3
  528. package/dist/esm/logo-variations-tabs.entry.js +2 -2
  529. package/dist/esm/logo-wrong-usage.entry.js +2 -2
  530. package/dist/esm/svg-repository.entry.js +9 -21
  531. package/dist/esm/token-list_3.entry.js +4 -4
  532. package/dist/esm/token-ratios.entry.js +2 -2
  533. package/dist/esm/token-spacing.entry.js +2 -2
  534. package/dist/esm/token-typography.entry.js +2 -2
  535. package/dist/esm/view-e900f2d4.js +3 -0
  536. package/dist/hydrate/index.js +852 -327
  537. package/dist/hydrate/index.mjs +852 -327
  538. package/dist/types/Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/svgs/src/lib/svgs.d.ts +3 -1
  539. package/dist/types/components/eds-alert/eds-alert.d.ts +6 -0
  540. package/dist/types/components/eds-button/eds-button.d.ts +1 -0
  541. package/dist/types/components/eds-icons/eds-icon-clone/eds-icon-clone.d.ts +10 -0
  542. package/dist/types/components/eds-icons/eds-icon-download/eds-icon-download.d.ts +10 -0
  543. package/dist/types/components/eds-icons/eds-icon-view/eds-icon-view.d.ts +10 -0
  544. package/dist/types/components/eds-link/eds-link.d.ts +1 -0
  545. package/dist/types/components/eds-nps/eds-npm.stories.d.ts +28 -0
  546. package/dist/types/components/eds-nps/eds-nps.d.ts +20 -0
  547. package/dist/types/components/eds-pagination/eds-pagination.d.ts +23 -2
  548. package/dist/types/components/eds-rating/eds-rating.d.ts +3 -1
  549. package/dist/types/components/eds-switch/eds-switch.d.ts +1 -0
  550. package/dist/types/components/eds-table/eds-table.d.ts +23 -8
  551. package/dist/types/components/eds-table/eds-table.stories.d.ts +7 -2
  552. package/dist/types/components.d.ts +421 -41
  553. package/dist/types/shared-ui/eds-footer/eds-footer.d.ts +4 -2
  554. package/dist/types/shared-ui/eds-form/eds-form.d.ts +18 -0
  555. package/dist/types/shared-ui/eds-form/eds-form.stories.d.ts +19 -0
  556. package/dist/types/shared-ui/eds-fullscreen-menu/eds-fullscreen-menu.d.ts +44 -13
  557. package/dist/types/shared-ui/eds-matomo-notice/eds-matomo-notice.d.ts +11 -3
  558. package/dist/types/shared-ui/eds-social-networks/eds-social-networks.d.ts +0 -2
  559. package/dist/types/shared-ui/eds-social-networks/eds-social-networks.stories.d.ts +1 -1
  560. package/dist/types/shared-ui/eds-steps/eds-steps.d.ts +72 -24
  561. package/dist/types/shared-ui/eds-steps/eds-steps.stories.d.ts +58 -0
  562. package/dist/types/shared-ui/eds-steps-v2/eds-steps-v2.d.ts +42 -19
  563. package/dist/types/shared-ui/eds-steps-v2/eds-steps-v2.stories.d.ts +33 -0
  564. package/dist/types/shared-ui/eds-tabs/eds-tabs.d.ts +7 -9
  565. package/dist/types/shared-ui/eds-user/eds-user.d.ts +5 -0
  566. package/dist/types/utils/eds-form/formValidators.d.ts +1 -0
  567. package/package.json +1 -1
  568. package/dist/cjs/edit-5714c144.js +0 -5
  569. package/dist/cjs/eds-accordion.cjs.entry.js +0 -87
  570. package/dist/cjs/eds-alert.cjs.entry.js +0 -104
  571. package/dist/cjs/eds-breadcrumb.cjs.entry.js +0 -145
  572. package/dist/cjs/eds-code-block.cjs.entry.js +0 -2489
  573. package/dist/cjs/eds-matomo-notice.cjs.entry.js +0 -125
  574. package/dist/cjs/eds-switch.cjs.entry.js +0 -46
  575. package/dist/cjs/eds-tooltip.cjs.entry.js +0 -38
  576. package/dist/components/p-023bc47c.entry.js +0 -1
  577. package/dist/components/p-02df910c.entry.js +0 -1
  578. package/dist/components/p-0be79e08.entry.js +0 -1
  579. package/dist/components/p-0e74d8b4.entry.js +0 -1
  580. package/dist/components/p-11efb1d1.entry.js +0 -1
  581. package/dist/components/p-1791ce82.entry.js +0 -1
  582. package/dist/components/p-19d586e6.entry.js +0 -1
  583. package/dist/components/p-2679926c.entry.js +0 -1
  584. package/dist/components/p-2d1a7471.entry.js +0 -1
  585. package/dist/components/p-2ff16a39.entry.js +0 -1
  586. package/dist/components/p-32e18e48.entry.js +0 -1
  587. package/dist/components/p-38e99d4b.entry.js +0 -1
  588. package/dist/components/p-3a331c68.entry.js +0 -1
  589. package/dist/components/p-4088ae0e.entry.js +0 -1
  590. package/dist/components/p-4277fb1a.entry.js +0 -1
  591. package/dist/components/p-42a73db4.entry.js +0 -1
  592. package/dist/components/p-43468b0f.entry.js +0 -1
  593. package/dist/components/p-44055e68.entry.js +0 -1
  594. package/dist/components/p-4a5d0dcd.entry.js +0 -1
  595. package/dist/components/p-4a7412ec.entry.js +0 -1
  596. package/dist/components/p-4b88d84c.entry.js +0 -1
  597. package/dist/components/p-50f43dfd.entry.js +0 -1
  598. package/dist/components/p-562afa88.entry.js +0 -1
  599. package/dist/components/p-564431ad.entry.js +0 -1
  600. package/dist/components/p-5aa4065a.entry.js +0 -1
  601. package/dist/components/p-5ae1c931.entry.js +0 -1
  602. package/dist/components/p-634258e6.entry.js +0 -1
  603. package/dist/components/p-68f45098.entry.js +0 -1
  604. package/dist/components/p-73a44c48.entry.js +0 -1
  605. package/dist/components/p-73c74835.entry.js +0 -1
  606. package/dist/components/p-76905315.entry.js +0 -1
  607. package/dist/components/p-7dbe791f.entry.js +0 -1
  608. package/dist/components/p-7ec52188.entry.js +0 -1
  609. package/dist/components/p-7fc84bb2.js +0 -1
  610. package/dist/components/p-82559816.entry.js +0 -1
  611. package/dist/components/p-85683b18.entry.js +0 -1
  612. package/dist/components/p-8681e5d8.entry.js +0 -1
  613. package/dist/components/p-877d13d9.entry.js +0 -1
  614. package/dist/components/p-8dee879d.entry.js +0 -1
  615. package/dist/components/p-911b1c0b.entry.js +0 -1
  616. package/dist/components/p-93e6ba0f.entry.js +0 -1
  617. package/dist/components/p-960aa103.entry.js +0 -1
  618. package/dist/components/p-996005b7.entry.js +0 -1
  619. package/dist/components/p-9e53eca3.entry.js +0 -1
  620. package/dist/components/p-aa5e75b4.entry.js +0 -1
  621. package/dist/components/p-ae9393b6.entry.js +0 -1
  622. package/dist/components/p-af137162.entry.js +0 -1
  623. package/dist/components/p-b630e51a.entry.js +0 -1
  624. package/dist/components/p-bb9af709.entry.js +0 -1
  625. package/dist/components/p-c2dc3692.entry.js +0 -1
  626. package/dist/components/p-c91b4eec.entry.js +0 -1
  627. package/dist/components/p-caff3355.entry.js +0 -1
  628. package/dist/components/p-ce66ea37.entry.js +0 -1
  629. package/dist/components/p-d4f239d7.entry.js +0 -1
  630. package/dist/components/p-d7251d4d.entry.js +0 -1
  631. package/dist/components/p-deb9bbed.entry.js +0 -1
  632. package/dist/components/p-ed7696a2.entry.js +0 -1
  633. package/dist/components/p-f2416727.entry.js +0 -1
  634. package/dist/components/p-f28b5da7.entry.js +0 -1
  635. package/dist/components/p-f3839914.entry.js +0 -1
  636. package/dist/components/p-f42b6251.entry.js +0 -1
  637. package/dist/components/p-f7a31196.entry.js +0 -1
  638. package/dist/components/p-f973c83b.entry.js +0 -1
  639. package/dist/components/p-fe167c78.entry.js +0 -9
  640. package/dist/esm/edit-1dc8d11b.js +0 -3
  641. package/dist/esm/eds-accordion.entry.js +0 -83
  642. package/dist/esm/eds-alert.entry.js +0 -100
  643. package/dist/esm/eds-breadcrumb.entry.js +0 -141
  644. package/dist/esm/eds-code-block.entry.js +0 -2485
  645. package/dist/esm/eds-matomo-notice.entry.js +0 -121
  646. package/dist/esm/eds-switch.entry.js +0 -42
  647. package/dist/esm/eds-tooltip.entry.js +0 -34
  648. /package/dist/collection/shared-ui/eds-toast-manager/{eds-toast-manager.stories.js → eds-toast-manager.st.js} +0 -0
  649. /package/dist/types/shared-ui/eds-toast-manager/{eds-toast-manager.stories.d.ts → eds-toast-manager.st.d.ts} +0 -0
@@ -1,2485 +0,0 @@
1
- import { r as registerInstance, h, g as getElement } from './index-fdb33359.js';
2
-
3
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
-
5
- var prism = {exports: {}};
6
-
7
- (function (module) {
8
- /* **********************************************
9
- Begin prism-core.js
10
- ********************************************** */
11
-
12
- /// <reference lib="WebWorker"/>
13
-
14
- var _self = (typeof window !== 'undefined')
15
- ? window // if in browser
16
- : (
17
- (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
18
- ? self // if in worker
19
- : {} // if in node js
20
- );
21
-
22
- /**
23
- * Prism: Lightweight, robust, elegant syntax highlighting
24
- *
25
- * @license MIT <https://opensource.org/licenses/MIT>
26
- * @author Lea Verou <https://lea.verou.me>
27
- * @namespace
28
- * @public
29
- */
30
- var Prism = (function (_self) {
31
-
32
- // Private helper vars
33
- var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
34
- var uniqueId = 0;
35
-
36
- // The grammar object for plaintext
37
- var plainTextGrammar = {};
38
-
39
-
40
- var _ = {
41
- /**
42
- * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
43
- * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
44
- * additional languages or plugins yourself.
45
- *
46
- * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
47
- *
48
- * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
49
- * empty Prism object into the global scope before loading the Prism script like this:
50
- *
51
- * ```js
52
- * window.Prism = window.Prism || {};
53
- * Prism.manual = true;
54
- * // add a new <script> to load Prism's script
55
- * ```
56
- *
57
- * @default false
58
- * @type {boolean}
59
- * @memberof Prism
60
- * @public
61
- */
62
- manual: _self.Prism && _self.Prism.manual,
63
- /**
64
- * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
65
- * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
66
- * own worker, you don't want it to do this.
67
- *
68
- * By setting this value to `true`, Prism will not add its own listeners to the worker.
69
- *
70
- * You obviously have to change this value before Prism executes. To do this, you can add an
71
- * empty Prism object into the global scope before loading the Prism script like this:
72
- *
73
- * ```js
74
- * window.Prism = window.Prism || {};
75
- * Prism.disableWorkerMessageHandler = true;
76
- * // Load Prism's script
77
- * ```
78
- *
79
- * @default false
80
- * @type {boolean}
81
- * @memberof Prism
82
- * @public
83
- */
84
- disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
85
-
86
- /**
87
- * A namespace for utility methods.
88
- *
89
- * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
90
- * change or disappear at any time.
91
- *
92
- * @namespace
93
- * @memberof Prism
94
- */
95
- util: {
96
- encode: function encode(tokens) {
97
- if (tokens instanceof Token) {
98
- return new Token(tokens.type, encode(tokens.content), tokens.alias);
99
- } else if (Array.isArray(tokens)) {
100
- return tokens.map(encode);
101
- } else {
102
- return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
103
- }
104
- },
105
-
106
- /**
107
- * Returns the name of the type of the given value.
108
- *
109
- * @param {any} o
110
- * @returns {string}
111
- * @example
112
- * type(null) === 'Null'
113
- * type(undefined) === 'Undefined'
114
- * type(123) === 'Number'
115
- * type('foo') === 'String'
116
- * type(true) === 'Boolean'
117
- * type([1, 2]) === 'Array'
118
- * type({}) === 'Object'
119
- * type(String) === 'Function'
120
- * type(/abc+/) === 'RegExp'
121
- */
122
- type: function (o) {
123
- return Object.prototype.toString.call(o).slice(8, -1);
124
- },
125
-
126
- /**
127
- * Returns a unique number for the given object. Later calls will still return the same number.
128
- *
129
- * @param {Object} obj
130
- * @returns {number}
131
- */
132
- objId: function (obj) {
133
- if (!obj['__id']) {
134
- Object.defineProperty(obj, '__id', { value: ++uniqueId });
135
- }
136
- return obj['__id'];
137
- },
138
-
139
- /**
140
- * Creates a deep clone of the given object.
141
- *
142
- * The main intended use of this function is to clone language definitions.
143
- *
144
- * @param {T} o
145
- * @param {Record<number, any>} [visited]
146
- * @returns {T}
147
- * @template T
148
- */
149
- clone: function deepClone(o, visited) {
150
- visited = visited || {};
151
-
152
- var clone; var id;
153
- switch (_.util.type(o)) {
154
- case 'Object':
155
- id = _.util.objId(o);
156
- if (visited[id]) {
157
- return visited[id];
158
- }
159
- clone = /** @type {Record<string, any>} */ ({});
160
- visited[id] = clone;
161
-
162
- for (var key in o) {
163
- if (o.hasOwnProperty(key)) {
164
- clone[key] = deepClone(o[key], visited);
165
- }
166
- }
167
-
168
- return /** @type {any} */ (clone);
169
-
170
- case 'Array':
171
- id = _.util.objId(o);
172
- if (visited[id]) {
173
- return visited[id];
174
- }
175
- clone = [];
176
- visited[id] = clone;
177
-
178
- (/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {
179
- clone[i] = deepClone(v, visited);
180
- });
181
-
182
- return /** @type {any} */ (clone);
183
-
184
- default:
185
- return o;
186
- }
187
- },
188
-
189
- /**
190
- * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
191
- *
192
- * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
193
- *
194
- * @param {Element} element
195
- * @returns {string}
196
- */
197
- getLanguage: function (element) {
198
- while (element) {
199
- var m = lang.exec(element.className);
200
- if (m) {
201
- return m[1].toLowerCase();
202
- }
203
- element = element.parentElement;
204
- }
205
- return 'none';
206
- },
207
-
208
- /**
209
- * Sets the Prism `language-xxxx` class of the given element.
210
- *
211
- * @param {Element} element
212
- * @param {string} language
213
- * @returns {void}
214
- */
215
- setLanguage: function (element, language) {
216
- // remove all `language-xxxx` classes
217
- // (this might leave behind a leading space)
218
- element.className = element.className.replace(RegExp(lang, 'gi'), '');
219
-
220
- // add the new `language-xxxx` class
221
- // (using `classList` will automatically clean up spaces for us)
222
- element.classList.add('language-' + language);
223
- },
224
-
225
- /**
226
- * Returns the script element that is currently executing.
227
- *
228
- * This does __not__ work for line script element.
229
- *
230
- * @returns {HTMLScriptElement | null}
231
- */
232
- currentScript: function () {
233
- if (typeof document === 'undefined') {
234
- return null;
235
- }
236
- if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
237
- return /** @type {any} */ (document.currentScript);
238
- }
239
-
240
- // IE11 workaround
241
- // we'll get the src of the current script by parsing IE11's error stack trace
242
- // this will not work for inline scripts
243
-
244
- try {
245
- throw new Error();
246
- } catch (err) {
247
- // Get file src url from stack. Specifically works with the format of stack traces in IE.
248
- // A stack will look like this:
249
- //
250
- // Error
251
- // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
252
- // at Global code (http://localhost/components/prism-core.js:606:1)
253
-
254
- var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
255
- if (src) {
256
- var scripts = document.getElementsByTagName('script');
257
- for (var i in scripts) {
258
- if (scripts[i].src == src) {
259
- return scripts[i];
260
- }
261
- }
262
- }
263
- return null;
264
- }
265
- },
266
-
267
- /**
268
- * Returns whether a given class is active for `element`.
269
- *
270
- * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
271
- * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
272
- * given class is just the given class with a `no-` prefix.
273
- *
274
- * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
275
- * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
276
- * ancestors have the given class or the negated version of it, then the default activation will be returned.
277
- *
278
- * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
279
- * version of it, the class is considered active.
280
- *
281
- * @param {Element} element
282
- * @param {string} className
283
- * @param {boolean} [defaultActivation=false]
284
- * @returns {boolean}
285
- */
286
- isActive: function (element, className, defaultActivation) {
287
- var no = 'no-' + className;
288
-
289
- while (element) {
290
- var classList = element.classList;
291
- if (classList.contains(className)) {
292
- return true;
293
- }
294
- if (classList.contains(no)) {
295
- return false;
296
- }
297
- element = element.parentElement;
298
- }
299
- return !!defaultActivation;
300
- }
301
- },
302
-
303
- /**
304
- * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
305
- *
306
- * @namespace
307
- * @memberof Prism
308
- * @public
309
- */
310
- languages: {
311
- /**
312
- * The grammar for plain, unformatted text.
313
- */
314
- plain: plainTextGrammar,
315
- plaintext: plainTextGrammar,
316
- text: plainTextGrammar,
317
- txt: plainTextGrammar,
318
-
319
- /**
320
- * Creates a deep copy of the language with the given id and appends the given tokens.
321
- *
322
- * If a token in `redef` also appears in the copied language, then the existing token in the copied language
323
- * will be overwritten at its original position.
324
- *
325
- * ## Best practices
326
- *
327
- * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
328
- * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
329
- * understand the language definition because, normally, the order of tokens matters in Prism grammars.
330
- *
331
- * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
332
- * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
333
- *
334
- * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
335
- * @param {Grammar} redef The new tokens to append.
336
- * @returns {Grammar} The new language created.
337
- * @public
338
- * @example
339
- * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
340
- * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
341
- * // at its original position
342
- * 'comment': { ... },
343
- * // CSS doesn't have a 'color' token, so this token will be appended
344
- * 'color': /\b(?:red|green|blue)\b/
345
- * });
346
- */
347
- extend: function (id, redef) {
348
- var lang = _.util.clone(_.languages[id]);
349
-
350
- for (var key in redef) {
351
- lang[key] = redef[key];
352
- }
353
-
354
- return lang;
355
- },
356
-
357
- /**
358
- * Inserts tokens _before_ another token in a language definition or any other grammar.
359
- *
360
- * ## Usage
361
- *
362
- * This helper method makes it easy to modify existing languages. For example, the CSS language definition
363
- * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
364
- * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
365
- * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
366
- * this:
367
- *
368
- * ```js
369
- * Prism.languages.markup.style = {
370
- * // token
371
- * };
372
- * ```
373
- *
374
- * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
375
- * before existing tokens. For the CSS example above, you would use it like this:
376
- *
377
- * ```js
378
- * Prism.languages.insertBefore('markup', 'cdata', {
379
- * 'style': {
380
- * // token
381
- * }
382
- * });
383
- * ```
384
- *
385
- * ## Special cases
386
- *
387
- * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
388
- * will be ignored.
389
- *
390
- * This behavior can be used to insert tokens after `before`:
391
- *
392
- * ```js
393
- * Prism.languages.insertBefore('markup', 'comment', {
394
- * 'comment': Prism.languages.markup.comment,
395
- * // tokens after 'comment'
396
- * });
397
- * ```
398
- *
399
- * ## Limitations
400
- *
401
- * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
402
- * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
403
- * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
404
- * deleting properties which is necessary to insert at arbitrary positions.
405
- *
406
- * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
407
- * Instead, it will create a new object and replace all references to the target object with the new one. This
408
- * can be done without temporarily deleting properties, so the iteration order is well-defined.
409
- *
410
- * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
411
- * you hold the target object in a variable, then the value of the variable will not change.
412
- *
413
- * ```js
414
- * var oldMarkup = Prism.languages.markup;
415
- * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
416
- *
417
- * assert(oldMarkup !== Prism.languages.markup);
418
- * assert(newMarkup === Prism.languages.markup);
419
- * ```
420
- *
421
- * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
422
- * object to be modified.
423
- * @param {string} before The key to insert before.
424
- * @param {Grammar} insert An object containing the key-value pairs to be inserted.
425
- * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
426
- * object to be modified.
427
- *
428
- * Defaults to `Prism.languages`.
429
- * @returns {Grammar} The new grammar object.
430
- * @public
431
- */
432
- insertBefore: function (inside, before, insert, root) {
433
- root = root || /** @type {any} */ (_.languages);
434
- var grammar = root[inside];
435
- /** @type {Grammar} */
436
- var ret = {};
437
-
438
- for (var token in grammar) {
439
- if (grammar.hasOwnProperty(token)) {
440
-
441
- if (token == before) {
442
- for (var newToken in insert) {
443
- if (insert.hasOwnProperty(newToken)) {
444
- ret[newToken] = insert[newToken];
445
- }
446
- }
447
- }
448
-
449
- // Do not insert token which also occur in insert. See #1525
450
- if (!insert.hasOwnProperty(token)) {
451
- ret[token] = grammar[token];
452
- }
453
- }
454
- }
455
-
456
- var old = root[inside];
457
- root[inside] = ret;
458
-
459
- // Update references in other language definitions
460
- _.languages.DFS(_.languages, function (key, value) {
461
- if (value === old && key != inside) {
462
- this[key] = ret;
463
- }
464
- });
465
-
466
- return ret;
467
- },
468
-
469
- // Traverse a language definition with Depth First Search
470
- DFS: function DFS(o, callback, type, visited) {
471
- visited = visited || {};
472
-
473
- var objId = _.util.objId;
474
-
475
- for (var i in o) {
476
- if (o.hasOwnProperty(i)) {
477
- callback.call(o, i, o[i], type || i);
478
-
479
- var property = o[i];
480
- var propertyType = _.util.type(property);
481
-
482
- if (propertyType === 'Object' && !visited[objId(property)]) {
483
- visited[objId(property)] = true;
484
- DFS(property, callback, null, visited);
485
- } else if (propertyType === 'Array' && !visited[objId(property)]) {
486
- visited[objId(property)] = true;
487
- DFS(property, callback, i, visited);
488
- }
489
- }
490
- }
491
- }
492
- },
493
-
494
- plugins: {},
495
-
496
- /**
497
- * This is the most high-level function in Prism’s API.
498
- * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
499
- * each one of them.
500
- *
501
- * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
502
- *
503
- * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
504
- * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
505
- * @memberof Prism
506
- * @public
507
- */
508
- highlightAll: function (async, callback) {
509
- _.highlightAllUnder(document, async, callback);
510
- },
511
-
512
- /**
513
- * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
514
- * {@link Prism.highlightElement} on each one of them.
515
- *
516
- * The following hooks will be run:
517
- * 1. `before-highlightall`
518
- * 2. `before-all-elements-highlight`
519
- * 3. All hooks of {@link Prism.highlightElement} for each element.
520
- *
521
- * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
522
- * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
523
- * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
524
- * @memberof Prism
525
- * @public
526
- */
527
- highlightAllUnder: function (container, async, callback) {
528
- var env = {
529
- callback: callback,
530
- container: container,
531
- selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
532
- };
533
-
534
- _.hooks.run('before-highlightall', env);
535
-
536
- env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
537
-
538
- _.hooks.run('before-all-elements-highlight', env);
539
-
540
- for (var i = 0, element; (element = env.elements[i++]);) {
541
- _.highlightElement(element, async === true, env.callback);
542
- }
543
- },
544
-
545
- /**
546
- * Highlights the code inside a single element.
547
- *
548
- * The following hooks will be run:
549
- * 1. `before-sanity-check`
550
- * 2. `before-highlight`
551
- * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
552
- * 4. `before-insert`
553
- * 5. `after-highlight`
554
- * 6. `complete`
555
- *
556
- * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
557
- * the element's language.
558
- *
559
- * @param {Element} element The element containing the code.
560
- * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
561
- * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
562
- * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
563
- * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
564
- *
565
- * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
566
- * asynchronous highlighting to work. You can build your own bundle on the
567
- * [Download page](https://prismjs.com/download.html).
568
- * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
569
- * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
570
- * @memberof Prism
571
- * @public
572
- */
573
- highlightElement: function (element, async, callback) {
574
- // Find language
575
- var language = _.util.getLanguage(element);
576
- var grammar = _.languages[language];
577
-
578
- // Set language on the element, if not present
579
- _.util.setLanguage(element, language);
580
-
581
- // Set language on the parent, for styling
582
- var parent = element.parentElement;
583
- if (parent && parent.nodeName.toLowerCase() === 'pre') {
584
- _.util.setLanguage(parent, language);
585
- }
586
-
587
- var code = element.textContent;
588
-
589
- var env = {
590
- element: element,
591
- language: language,
592
- grammar: grammar,
593
- code: code
594
- };
595
-
596
- function insertHighlightedCode(highlightedCode) {
597
- env.highlightedCode = highlightedCode;
598
-
599
- _.hooks.run('before-insert', env);
600
-
601
- env.element.innerHTML = env.highlightedCode;
602
-
603
- _.hooks.run('after-highlight', env);
604
- _.hooks.run('complete', env);
605
- callback && callback.call(env.element);
606
- }
607
-
608
- _.hooks.run('before-sanity-check', env);
609
-
610
- // plugins may change/add the parent/element
611
- parent = env.element.parentElement;
612
- if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
613
- parent.setAttribute('tabindex', '0');
614
- }
615
-
616
- if (!env.code) {
617
- _.hooks.run('complete', env);
618
- callback && callback.call(env.element);
619
- return;
620
- }
621
-
622
- _.hooks.run('before-highlight', env);
623
-
624
- if (!env.grammar) {
625
- insertHighlightedCode(_.util.encode(env.code));
626
- return;
627
- }
628
-
629
- if (async && _self.Worker) {
630
- var worker = new Worker(_.filename);
631
-
632
- worker.onmessage = function (evt) {
633
- insertHighlightedCode(evt.data);
634
- };
635
-
636
- worker.postMessage(JSON.stringify({
637
- language: env.language,
638
- code: env.code,
639
- immediateClose: true
640
- }));
641
- } else {
642
- insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
643
- }
644
- },
645
-
646
- /**
647
- * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
648
- * and the language definitions to use, and returns a string with the HTML produced.
649
- *
650
- * The following hooks will be run:
651
- * 1. `before-tokenize`
652
- * 2. `after-tokenize`
653
- * 3. `wrap`: On each {@link Token}.
654
- *
655
- * @param {string} text A string with the code to be highlighted.
656
- * @param {Grammar} grammar An object containing the tokens to use.
657
- *
658
- * Usually a language definition like `Prism.languages.markup`.
659
- * @param {string} language The name of the language definition passed to `grammar`.
660
- * @returns {string} The highlighted HTML.
661
- * @memberof Prism
662
- * @public
663
- * @example
664
- * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
665
- */
666
- highlight: function (text, grammar, language) {
667
- var env = {
668
- code: text,
669
- grammar: grammar,
670
- language: language
671
- };
672
- _.hooks.run('before-tokenize', env);
673
- if (!env.grammar) {
674
- throw new Error('The language "' + env.language + '" has no grammar.');
675
- }
676
- env.tokens = _.tokenize(env.code, env.grammar);
677
- _.hooks.run('after-tokenize', env);
678
- return Token.stringify(_.util.encode(env.tokens), env.language);
679
- },
680
-
681
- /**
682
- * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
683
- * and the language definitions to use, and returns an array with the tokenized code.
684
- *
685
- * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
686
- *
687
- * This method could be useful in other contexts as well, as a very crude parser.
688
- *
689
- * @param {string} text A string with the code to be highlighted.
690
- * @param {Grammar} grammar An object containing the tokens to use.
691
- *
692
- * Usually a language definition like `Prism.languages.markup`.
693
- * @returns {TokenStream} An array of strings and tokens, a token stream.
694
- * @memberof Prism
695
- * @public
696
- * @example
697
- * let code = `var foo = 0;`;
698
- * let tokens = Prism.tokenize(code, Prism.languages.javascript);
699
- * tokens.forEach(token => {
700
- * if (token instanceof Prism.Token && token.type === 'number') {
701
- * console.log(`Found numeric literal: ${token.content}`);
702
- * }
703
- * });
704
- */
705
- tokenize: function (text, grammar) {
706
- var rest = grammar.rest;
707
- if (rest) {
708
- for (var token in rest) {
709
- grammar[token] = rest[token];
710
- }
711
-
712
- delete grammar.rest;
713
- }
714
-
715
- var tokenList = new LinkedList();
716
- addAfter(tokenList, tokenList.head, text);
717
-
718
- matchGrammar(text, tokenList, grammar, tokenList.head, 0);
719
-
720
- return toArray(tokenList);
721
- },
722
-
723
- /**
724
- * @namespace
725
- * @memberof Prism
726
- * @public
727
- */
728
- hooks: {
729
- all: {},
730
-
731
- /**
732
- * Adds the given callback to the list of callbacks for the given hook.
733
- *
734
- * The callback will be invoked when the hook it is registered for is run.
735
- * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
736
- *
737
- * One callback function can be registered to multiple hooks and the same hook multiple times.
738
- *
739
- * @param {string} name The name of the hook.
740
- * @param {HookCallback} callback The callback function which is given environment variables.
741
- * @public
742
- */
743
- add: function (name, callback) {
744
- var hooks = _.hooks.all;
745
-
746
- hooks[name] = hooks[name] || [];
747
-
748
- hooks[name].push(callback);
749
- },
750
-
751
- /**
752
- * Runs a hook invoking all registered callbacks with the given environment variables.
753
- *
754
- * Callbacks will be invoked synchronously and in the order in which they were registered.
755
- *
756
- * @param {string} name The name of the hook.
757
- * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
758
- * @public
759
- */
760
- run: function (name, env) {
761
- var callbacks = _.hooks.all[name];
762
-
763
- if (!callbacks || !callbacks.length) {
764
- return;
765
- }
766
-
767
- for (var i = 0, callback; (callback = callbacks[i++]);) {
768
- callback(env);
769
- }
770
- }
771
- },
772
-
773
- Token: Token
774
- };
775
- _self.Prism = _;
776
-
777
-
778
- // Typescript note:
779
- // The following can be used to import the Token type in JSDoc:
780
- //
781
- // @typedef {InstanceType<import("./prism-core")["Token"]>} Token
782
-
783
- /**
784
- * Creates a new token.
785
- *
786
- * @param {string} type See {@link Token#type type}
787
- * @param {string | TokenStream} content See {@link Token#content content}
788
- * @param {string|string[]} [alias] The alias(es) of the token.
789
- * @param {string} [matchedStr=""] A copy of the full string this token was created from.
790
- * @class
791
- * @global
792
- * @public
793
- */
794
- function Token(type, content, alias, matchedStr) {
795
- /**
796
- * The type of the token.
797
- *
798
- * This is usually the key of a pattern in a {@link Grammar}.
799
- *
800
- * @type {string}
801
- * @see GrammarToken
802
- * @public
803
- */
804
- this.type = type;
805
- /**
806
- * The strings or tokens contained by this token.
807
- *
808
- * This will be a token stream if the pattern matched also defined an `inside` grammar.
809
- *
810
- * @type {string | TokenStream}
811
- * @public
812
- */
813
- this.content = content;
814
- /**
815
- * The alias(es) of the token.
816
- *
817
- * @type {string|string[]}
818
- * @see GrammarToken
819
- * @public
820
- */
821
- this.alias = alias;
822
- // Copy of the full string this token was created from
823
- this.length = (matchedStr || '').length | 0;
824
- }
825
-
826
- /**
827
- * A token stream is an array of strings and {@link Token Token} objects.
828
- *
829
- * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
830
- * them.
831
- *
832
- * 1. No adjacent strings.
833
- * 2. No empty strings.
834
- *
835
- * The only exception here is the token stream that only contains the empty string and nothing else.
836
- *
837
- * @typedef {Array<string | Token>} TokenStream
838
- * @global
839
- * @public
840
- */
841
-
842
- /**
843
- * Converts the given token or token stream to an HTML representation.
844
- *
845
- * The following hooks will be run:
846
- * 1. `wrap`: On each {@link Token}.
847
- *
848
- * @param {string | Token | TokenStream} o The token or token stream to be converted.
849
- * @param {string} language The name of current language.
850
- * @returns {string} The HTML representation of the token or token stream.
851
- * @memberof Token
852
- * @static
853
- */
854
- Token.stringify = function stringify(o, language) {
855
- if (typeof o == 'string') {
856
- return o;
857
- }
858
- if (Array.isArray(o)) {
859
- var s = '';
860
- o.forEach(function (e) {
861
- s += stringify(e, language);
862
- });
863
- return s;
864
- }
865
-
866
- var env = {
867
- type: o.type,
868
- content: stringify(o.content, language),
869
- tag: 'span',
870
- classes: ['token', o.type],
871
- attributes: {},
872
- language: language
873
- };
874
-
875
- var aliases = o.alias;
876
- if (aliases) {
877
- if (Array.isArray(aliases)) {
878
- Array.prototype.push.apply(env.classes, aliases);
879
- } else {
880
- env.classes.push(aliases);
881
- }
882
- }
883
-
884
- _.hooks.run('wrap', env);
885
-
886
- var attributes = '';
887
- for (var name in env.attributes) {
888
- attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
889
- }
890
-
891
- return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
892
- };
893
-
894
- /**
895
- * @param {RegExp} pattern
896
- * @param {number} pos
897
- * @param {string} text
898
- * @param {boolean} lookbehind
899
- * @returns {RegExpExecArray | null}
900
- */
901
- function matchPattern(pattern, pos, text, lookbehind) {
902
- pattern.lastIndex = pos;
903
- var match = pattern.exec(text);
904
- if (match && lookbehind && match[1]) {
905
- // change the match to remove the text matched by the Prism lookbehind group
906
- var lookbehindLength = match[1].length;
907
- match.index += lookbehindLength;
908
- match[0] = match[0].slice(lookbehindLength);
909
- }
910
- return match;
911
- }
912
-
913
- /**
914
- * @param {string} text
915
- * @param {LinkedList<string | Token>} tokenList
916
- * @param {any} grammar
917
- * @param {LinkedListNode<string | Token>} startNode
918
- * @param {number} startPos
919
- * @param {RematchOptions} [rematch]
920
- * @returns {void}
921
- * @private
922
- *
923
- * @typedef RematchOptions
924
- * @property {string} cause
925
- * @property {number} reach
926
- */
927
- function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
928
- for (var token in grammar) {
929
- if (!grammar.hasOwnProperty(token) || !grammar[token]) {
930
- continue;
931
- }
932
-
933
- var patterns = grammar[token];
934
- patterns = Array.isArray(patterns) ? patterns : [patterns];
935
-
936
- for (var j = 0; j < patterns.length; ++j) {
937
- if (rematch && rematch.cause == token + ',' + j) {
938
- return;
939
- }
940
-
941
- var patternObj = patterns[j];
942
- var inside = patternObj.inside;
943
- var lookbehind = !!patternObj.lookbehind;
944
- var greedy = !!patternObj.greedy;
945
- var alias = patternObj.alias;
946
-
947
- if (greedy && !patternObj.pattern.global) {
948
- // Without the global flag, lastIndex won't work
949
- var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
950
- patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
951
- }
952
-
953
- /** @type {RegExp} */
954
- var pattern = patternObj.pattern || patternObj;
955
-
956
- for ( // iterate the token list and keep track of the current token/string position
957
- var currentNode = startNode.next, pos = startPos;
958
- currentNode !== tokenList.tail;
959
- pos += currentNode.value.length, currentNode = currentNode.next
960
- ) {
961
-
962
- if (rematch && pos >= rematch.reach) {
963
- break;
964
- }
965
-
966
- var str = currentNode.value;
967
-
968
- if (tokenList.length > text.length) {
969
- // Something went terribly wrong, ABORT, ABORT!
970
- return;
971
- }
972
-
973
- if (str instanceof Token) {
974
- continue;
975
- }
976
-
977
- var removeCount = 1; // this is the to parameter of removeBetween
978
- var match;
979
-
980
- if (greedy) {
981
- match = matchPattern(pattern, pos, text, lookbehind);
982
- if (!match || match.index >= text.length) {
983
- break;
984
- }
985
-
986
- var from = match.index;
987
- var to = match.index + match[0].length;
988
- var p = pos;
989
-
990
- // find the node that contains the match
991
- p += currentNode.value.length;
992
- while (from >= p) {
993
- currentNode = currentNode.next;
994
- p += currentNode.value.length;
995
- }
996
- // adjust pos (and p)
997
- p -= currentNode.value.length;
998
- pos = p;
999
-
1000
- // the current node is a Token, then the match starts inside another Token, which is invalid
1001
- if (currentNode.value instanceof Token) {
1002
- continue;
1003
- }
1004
-
1005
- // find the last node which is affected by this match
1006
- for (
1007
- var k = currentNode;
1008
- k !== tokenList.tail && (p < to || typeof k.value === 'string');
1009
- k = k.next
1010
- ) {
1011
- removeCount++;
1012
- p += k.value.length;
1013
- }
1014
- removeCount--;
1015
-
1016
- // replace with the new match
1017
- str = text.slice(pos, p);
1018
- match.index -= pos;
1019
- } else {
1020
- match = matchPattern(pattern, 0, str, lookbehind);
1021
- if (!match) {
1022
- continue;
1023
- }
1024
- }
1025
-
1026
- // eslint-disable-next-line no-redeclare
1027
- var from = match.index;
1028
- var matchStr = match[0];
1029
- var before = str.slice(0, from);
1030
- var after = str.slice(from + matchStr.length);
1031
-
1032
- var reach = pos + str.length;
1033
- if (rematch && reach > rematch.reach) {
1034
- rematch.reach = reach;
1035
- }
1036
-
1037
- var removeFrom = currentNode.prev;
1038
-
1039
- if (before) {
1040
- removeFrom = addAfter(tokenList, removeFrom, before);
1041
- pos += before.length;
1042
- }
1043
-
1044
- removeRange(tokenList, removeFrom, removeCount);
1045
-
1046
- var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
1047
- currentNode = addAfter(tokenList, removeFrom, wrapped);
1048
-
1049
- if (after) {
1050
- addAfter(tokenList, currentNode, after);
1051
- }
1052
-
1053
- if (removeCount > 1) {
1054
- // at least one Token object was removed, so we have to do some rematching
1055
- // this can only happen if the current pattern is greedy
1056
-
1057
- /** @type {RematchOptions} */
1058
- var nestedRematch = {
1059
- cause: token + ',' + j,
1060
- reach: reach
1061
- };
1062
- matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
1063
-
1064
- // the reach might have been extended because of the rematching
1065
- if (rematch && nestedRematch.reach > rematch.reach) {
1066
- rematch.reach = nestedRematch.reach;
1067
- }
1068
- }
1069
- }
1070
- }
1071
- }
1072
- }
1073
-
1074
- /**
1075
- * @typedef LinkedListNode
1076
- * @property {T} value
1077
- * @property {LinkedListNode<T> | null} prev The previous node.
1078
- * @property {LinkedListNode<T> | null} next The next node.
1079
- * @template T
1080
- * @private
1081
- */
1082
-
1083
- /**
1084
- * @template T
1085
- * @private
1086
- */
1087
- function LinkedList() {
1088
- /** @type {LinkedListNode<T>} */
1089
- var head = { value: null, prev: null, next: null };
1090
- /** @type {LinkedListNode<T>} */
1091
- var tail = { value: null, prev: head, next: null };
1092
- head.next = tail;
1093
-
1094
- /** @type {LinkedListNode<T>} */
1095
- this.head = head;
1096
- /** @type {LinkedListNode<T>} */
1097
- this.tail = tail;
1098
- this.length = 0;
1099
- }
1100
-
1101
- /**
1102
- * Adds a new node with the given value to the list.
1103
- *
1104
- * @param {LinkedList<T>} list
1105
- * @param {LinkedListNode<T>} node
1106
- * @param {T} value
1107
- * @returns {LinkedListNode<T>} The added node.
1108
- * @template T
1109
- */
1110
- function addAfter(list, node, value) {
1111
- // assumes that node != list.tail && values.length >= 0
1112
- var next = node.next;
1113
-
1114
- var newNode = { value: value, prev: node, next: next };
1115
- node.next = newNode;
1116
- next.prev = newNode;
1117
- list.length++;
1118
-
1119
- return newNode;
1120
- }
1121
- /**
1122
- * Removes `count` nodes after the given node. The given node will not be removed.
1123
- *
1124
- * @param {LinkedList<T>} list
1125
- * @param {LinkedListNode<T>} node
1126
- * @param {number} count
1127
- * @template T
1128
- */
1129
- function removeRange(list, node, count) {
1130
- var next = node.next;
1131
- for (var i = 0; i < count && next !== list.tail; i++) {
1132
- next = next.next;
1133
- }
1134
- node.next = next;
1135
- next.prev = node;
1136
- list.length -= i;
1137
- }
1138
- /**
1139
- * @param {LinkedList<T>} list
1140
- * @returns {T[]}
1141
- * @template T
1142
- */
1143
- function toArray(list) {
1144
- var array = [];
1145
- var node = list.head.next;
1146
- while (node !== list.tail) {
1147
- array.push(node.value);
1148
- node = node.next;
1149
- }
1150
- return array;
1151
- }
1152
-
1153
-
1154
- if (!_self.document) {
1155
- if (!_self.addEventListener) {
1156
- // in Node.js
1157
- return _;
1158
- }
1159
-
1160
- if (!_.disableWorkerMessageHandler) {
1161
- // In worker
1162
- _self.addEventListener('message', function (evt) {
1163
- var message = JSON.parse(evt.data);
1164
- var lang = message.language;
1165
- var code = message.code;
1166
- var immediateClose = message.immediateClose;
1167
-
1168
- _self.postMessage(_.highlight(code, _.languages[lang], lang));
1169
- if (immediateClose) {
1170
- _self.close();
1171
- }
1172
- }, false);
1173
- }
1174
-
1175
- return _;
1176
- }
1177
-
1178
- // Get current script and highlight
1179
- var script = _.util.currentScript();
1180
-
1181
- if (script) {
1182
- _.filename = script.src;
1183
-
1184
- if (script.hasAttribute('data-manual')) {
1185
- _.manual = true;
1186
- }
1187
- }
1188
-
1189
- function highlightAutomaticallyCallback() {
1190
- if (!_.manual) {
1191
- _.highlightAll();
1192
- }
1193
- }
1194
-
1195
- if (!_.manual) {
1196
- // If the document state is "loading", then we'll use DOMContentLoaded.
1197
- // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
1198
- // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
1199
- // might take longer one animation frame to execute which can create a race condition where only some plugins have
1200
- // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
1201
- // See https://github.com/PrismJS/prism/issues/2102
1202
- var readyState = document.readyState;
1203
- if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
1204
- document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
1205
- } else {
1206
- if (window.requestAnimationFrame) {
1207
- window.requestAnimationFrame(highlightAutomaticallyCallback);
1208
- } else {
1209
- window.setTimeout(highlightAutomaticallyCallback, 16);
1210
- }
1211
- }
1212
- }
1213
-
1214
- return _;
1215
-
1216
- }(_self));
1217
-
1218
- if (module.exports) {
1219
- module.exports = Prism;
1220
- }
1221
-
1222
- // hack for components to work correctly in node.js
1223
- if (typeof commonjsGlobal !== 'undefined') {
1224
- commonjsGlobal.Prism = Prism;
1225
- }
1226
-
1227
- // some additional documentation/types
1228
-
1229
- /**
1230
- * The expansion of a simple `RegExp` literal to support additional properties.
1231
- *
1232
- * @typedef GrammarToken
1233
- * @property {RegExp} pattern The regular expression of the token.
1234
- * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)
1235
- * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
1236
- * @property {boolean} [greedy=false] Whether the token is greedy.
1237
- * @property {string|string[]} [alias] An optional alias or list of aliases.
1238
- * @property {Grammar} [inside] The nested grammar of this token.
1239
- *
1240
- * The `inside` grammar will be used to tokenize the text value of each token of this kind.
1241
- *
1242
- * This can be used to make nested and even recursive language definitions.
1243
- *
1244
- * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into
1245
- * each another.
1246
- * @global
1247
- * @public
1248
- */
1249
-
1250
- /**
1251
- * @typedef Grammar
1252
- * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
1253
- * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
1254
- * @global
1255
- * @public
1256
- */
1257
-
1258
- /**
1259
- * A function which will invoked after an element was successfully highlighted.
1260
- *
1261
- * @callback HighlightCallback
1262
- * @param {Element} element The element successfully highlighted.
1263
- * @returns {void}
1264
- * @global
1265
- * @public
1266
- */
1267
-
1268
- /**
1269
- * @callback HookCallback
1270
- * @param {Object<string, any>} env The environment variables of the hook.
1271
- * @returns {void}
1272
- * @global
1273
- * @public
1274
- */
1275
-
1276
-
1277
- /* **********************************************
1278
- Begin prism-markup.js
1279
- ********************************************** */
1280
-
1281
- Prism.languages.markup = {
1282
- 'comment': {
1283
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1284
- greedy: true
1285
- },
1286
- 'prolog': {
1287
- pattern: /<\?[\s\S]+?\?>/,
1288
- greedy: true
1289
- },
1290
- 'doctype': {
1291
- // https://www.w3.org/TR/xml/#NT-doctypedecl
1292
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1293
- greedy: true,
1294
- inside: {
1295
- 'internal-subset': {
1296
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1297
- lookbehind: true,
1298
- greedy: true,
1299
- inside: null // see below
1300
- },
1301
- 'string': {
1302
- pattern: /"[^"]*"|'[^']*'/,
1303
- greedy: true
1304
- },
1305
- 'punctuation': /^<!|>$|[[\]]/,
1306
- 'doctype-tag': /^DOCTYPE/i,
1307
- 'name': /[^\s<>'"]+/
1308
- }
1309
- },
1310
- 'cdata': {
1311
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1312
- greedy: true
1313
- },
1314
- 'tag': {
1315
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1316
- greedy: true,
1317
- inside: {
1318
- 'tag': {
1319
- pattern: /^<\/?[^\s>\/]+/,
1320
- inside: {
1321
- 'punctuation': /^<\/?/,
1322
- 'namespace': /^[^\s>\/:]+:/
1323
- }
1324
- },
1325
- 'special-attr': [],
1326
- 'attr-value': {
1327
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1328
- inside: {
1329
- 'punctuation': [
1330
- {
1331
- pattern: /^=/,
1332
- alias: 'attr-equals'
1333
- },
1334
- {
1335
- pattern: /^(\s*)["']|["']$/,
1336
- lookbehind: true
1337
- }
1338
- ]
1339
- }
1340
- },
1341
- 'punctuation': /\/?>/,
1342
- 'attr-name': {
1343
- pattern: /[^\s>\/]+/,
1344
- inside: {
1345
- 'namespace': /^[^\s>\/:]+:/
1346
- }
1347
- }
1348
-
1349
- }
1350
- },
1351
- 'entity': [
1352
- {
1353
- pattern: /&[\da-z]{1,8};/i,
1354
- alias: 'named-entity'
1355
- },
1356
- /&#x?[\da-f]{1,8};/i
1357
- ]
1358
- };
1359
-
1360
- Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
1361
- Prism.languages.markup['entity'];
1362
- Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
1363
-
1364
- // Plugin to make entity title show the real entity, idea by Roman Komarov
1365
- Prism.hooks.add('wrap', function (env) {
1366
-
1367
- if (env.type === 'entity') {
1368
- env.attributes['title'] = env.content.replace(/&amp;/, '&');
1369
- }
1370
- });
1371
-
1372
- Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1373
- /**
1374
- * Adds an inlined language to markup.
1375
- *
1376
- * An example of an inlined language is CSS with `<style>` tags.
1377
- *
1378
- * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1379
- * case insensitive.
1380
- * @param {string} lang The language key.
1381
- * @example
1382
- * addInlined('style', 'css');
1383
- */
1384
- value: function addInlined(tagName, lang) {
1385
- var includedCdataInside = {};
1386
- includedCdataInside['language-' + lang] = {
1387
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1388
- lookbehind: true,
1389
- inside: Prism.languages[lang]
1390
- };
1391
- includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
1392
-
1393
- var inside = {
1394
- 'included-cdata': {
1395
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1396
- inside: includedCdataInside
1397
- }
1398
- };
1399
- inside['language-' + lang] = {
1400
- pattern: /[\s\S]+/,
1401
- inside: Prism.languages[lang]
1402
- };
1403
-
1404
- var def = {};
1405
- def[tagName] = {
1406
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
1407
- lookbehind: true,
1408
- greedy: true,
1409
- inside: inside
1410
- };
1411
-
1412
- Prism.languages.insertBefore('markup', 'cdata', def);
1413
- }
1414
- });
1415
- Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1416
- /**
1417
- * Adds an pattern to highlight languages embedded in HTML attributes.
1418
- *
1419
- * An example of an inlined language is CSS with `style` attributes.
1420
- *
1421
- * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1422
- * case insensitive.
1423
- * @param {string} lang The language key.
1424
- * @example
1425
- * addAttribute('style', 'css');
1426
- */
1427
- value: function (attrName, lang) {
1428
- Prism.languages.markup.tag.inside['special-attr'].push({
1429
- pattern: RegExp(
1430
- /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1431
- 'i'
1432
- ),
1433
- lookbehind: true,
1434
- inside: {
1435
- 'attr-name': /^[^\s=]+/,
1436
- 'attr-value': {
1437
- pattern: /=[\s\S]+/,
1438
- inside: {
1439
- 'value': {
1440
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1441
- lookbehind: true,
1442
- alias: [lang, 'language-' + lang],
1443
- inside: Prism.languages[lang]
1444
- },
1445
- 'punctuation': [
1446
- {
1447
- pattern: /^=/,
1448
- alias: 'attr-equals'
1449
- },
1450
- /"|'/
1451
- ]
1452
- }
1453
- }
1454
- }
1455
- });
1456
- }
1457
- });
1458
-
1459
- Prism.languages.html = Prism.languages.markup;
1460
- Prism.languages.mathml = Prism.languages.markup;
1461
- Prism.languages.svg = Prism.languages.markup;
1462
-
1463
- Prism.languages.xml = Prism.languages.extend('markup', {});
1464
- Prism.languages.ssml = Prism.languages.xml;
1465
- Prism.languages.atom = Prism.languages.xml;
1466
- Prism.languages.rss = Prism.languages.xml;
1467
-
1468
-
1469
- /* **********************************************
1470
- Begin prism-css.js
1471
- ********************************************** */
1472
-
1473
- (function (Prism) {
1474
-
1475
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1476
-
1477
- Prism.languages.css = {
1478
- 'comment': /\/\*[\s\S]*?\*\//,
1479
- 'atrule': {
1480
- pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
1481
- inside: {
1482
- 'rule': /^@[\w-]+/,
1483
- 'selector-function-argument': {
1484
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1485
- lookbehind: true,
1486
- alias: 'selector'
1487
- },
1488
- 'keyword': {
1489
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1490
- lookbehind: true
1491
- }
1492
- // See rest below
1493
- }
1494
- },
1495
- 'url': {
1496
- // https://drafts.csswg.org/css-values-3/#urls
1497
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
1498
- greedy: true,
1499
- inside: {
1500
- 'function': /^url/i,
1501
- 'punctuation': /^\(|\)$/,
1502
- 'string': {
1503
- pattern: RegExp('^' + string.source + '$'),
1504
- alias: 'url'
1505
- }
1506
- }
1507
- },
1508
- 'selector': {
1509
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
1510
- lookbehind: true
1511
- },
1512
- 'string': {
1513
- pattern: string,
1514
- greedy: true
1515
- },
1516
- 'property': {
1517
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1518
- lookbehind: true
1519
- },
1520
- 'important': /!important\b/i,
1521
- 'function': {
1522
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1523
- lookbehind: true
1524
- },
1525
- 'punctuation': /[(){};:,]/
1526
- };
1527
-
1528
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
1529
-
1530
- var markup = Prism.languages.markup;
1531
- if (markup) {
1532
- markup.tag.addInlined('style', 'css');
1533
- markup.tag.addAttribute('style', 'css');
1534
- }
1535
-
1536
- }(Prism));
1537
-
1538
-
1539
- /* **********************************************
1540
- Begin prism-clike.js
1541
- ********************************************** */
1542
-
1543
- Prism.languages.clike = {
1544
- 'comment': [
1545
- {
1546
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1547
- lookbehind: true,
1548
- greedy: true
1549
- },
1550
- {
1551
- pattern: /(^|[^\\:])\/\/.*/,
1552
- lookbehind: true,
1553
- greedy: true
1554
- }
1555
- ],
1556
- 'string': {
1557
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1558
- greedy: true
1559
- },
1560
- 'class-name': {
1561
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
1562
- lookbehind: true,
1563
- inside: {
1564
- 'punctuation': /[.\\]/
1565
- }
1566
- },
1567
- 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
1568
- 'boolean': /\b(?:false|true)\b/,
1569
- 'function': /\b\w+(?=\()/,
1570
- 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1571
- 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1572
- 'punctuation': /[{}[\];(),.:]/
1573
- };
1574
-
1575
-
1576
- /* **********************************************
1577
- Begin prism-javascript.js
1578
- ********************************************** */
1579
-
1580
- Prism.languages.javascript = Prism.languages.extend('clike', {
1581
- 'class-name': [
1582
- Prism.languages.clike['class-name'],
1583
- {
1584
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1585
- lookbehind: true
1586
- }
1587
- ],
1588
- 'keyword': [
1589
- {
1590
- pattern: /((?:^|\})\s*)catch\b/,
1591
- lookbehind: true
1592
- },
1593
- {
1594
- pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1595
- lookbehind: true
1596
- },
1597
- ],
1598
- // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1599
- 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1600
- 'number': {
1601
- pattern: RegExp(
1602
- /(^|[^\w$])/.source +
1603
- '(?:' +
1604
- (
1605
- // constant
1606
- /NaN|Infinity/.source +
1607
- '|' +
1608
- // binary integer
1609
- /0[bB][01]+(?:_[01]+)*n?/.source +
1610
- '|' +
1611
- // octal integer
1612
- /0[oO][0-7]+(?:_[0-7]+)*n?/.source +
1613
- '|' +
1614
- // hexadecimal integer
1615
- /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
1616
- '|' +
1617
- // decimal bigint
1618
- /\d+(?:_\d+)*n/.source +
1619
- '|' +
1620
- // decimal number (integer or float) but no bigint
1621
- /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
1622
- ) +
1623
- ')' +
1624
- /(?![\w$])/.source
1625
- ),
1626
- lookbehind: true
1627
- },
1628
- 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1629
- });
1630
-
1631
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
1632
-
1633
- Prism.languages.insertBefore('javascript', 'keyword', {
1634
- 'regex': {
1635
- pattern: RegExp(
1636
- // lookbehind
1637
- // eslint-disable-next-line regexp/no-dupe-characters-character-class
1638
- /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
1639
- // Regex pattern:
1640
- // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
1641
- // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
1642
- // with the only syntax, so we have to define 2 different regex patterns.
1643
- /\//.source +
1644
- '(?:' +
1645
- /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source +
1646
- '|' +
1647
- // `v` flag syntax. This supports 3 levels of nested character classes.
1648
- /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +
1649
- ')' +
1650
- // lookahead
1651
- /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
1652
- ),
1653
- lookbehind: true,
1654
- greedy: true,
1655
- inside: {
1656
- 'regex-source': {
1657
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1658
- lookbehind: true,
1659
- alias: 'language-regex',
1660
- inside: Prism.languages.regex
1661
- },
1662
- 'regex-delimiter': /^\/|\/$/,
1663
- 'regex-flags': /^[a-z]+$/,
1664
- }
1665
- },
1666
- // This must be declared before keyword because we use "function" inside the look-forward
1667
- 'function-variable': {
1668
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
1669
- alias: 'function'
1670
- },
1671
- 'parameter': [
1672
- {
1673
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1674
- lookbehind: true,
1675
- inside: Prism.languages.javascript
1676
- },
1677
- {
1678
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1679
- lookbehind: true,
1680
- inside: Prism.languages.javascript
1681
- },
1682
- {
1683
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1684
- lookbehind: true,
1685
- inside: Prism.languages.javascript
1686
- },
1687
- {
1688
- pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1689
- lookbehind: true,
1690
- inside: Prism.languages.javascript
1691
- }
1692
- ],
1693
- 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1694
- });
1695
-
1696
- Prism.languages.insertBefore('javascript', 'string', {
1697
- 'hashbang': {
1698
- pattern: /^#!.*/,
1699
- greedy: true,
1700
- alias: 'comment'
1701
- },
1702
- 'template-string': {
1703
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1704
- greedy: true,
1705
- inside: {
1706
- 'template-punctuation': {
1707
- pattern: /^`|`$/,
1708
- alias: 'string'
1709
- },
1710
- 'interpolation': {
1711
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1712
- lookbehind: true,
1713
- inside: {
1714
- 'interpolation-punctuation': {
1715
- pattern: /^\$\{|\}$/,
1716
- alias: 'punctuation'
1717
- },
1718
- rest: Prism.languages.javascript
1719
- }
1720
- },
1721
- 'string': /[\s\S]+/
1722
- }
1723
- },
1724
- 'string-property': {
1725
- pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1726
- lookbehind: true,
1727
- greedy: true,
1728
- alias: 'property'
1729
- }
1730
- });
1731
-
1732
- Prism.languages.insertBefore('javascript', 'operator', {
1733
- 'literal-property': {
1734
- pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1735
- lookbehind: true,
1736
- alias: 'property'
1737
- },
1738
- });
1739
-
1740
- if (Prism.languages.markup) {
1741
- Prism.languages.markup.tag.addInlined('script', 'javascript');
1742
-
1743
- // add attribute support for all DOM events.
1744
- // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
1745
- Prism.languages.markup.tag.addAttribute(
1746
- /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
1747
- 'javascript'
1748
- );
1749
- }
1750
-
1751
- Prism.languages.js = Prism.languages.javascript;
1752
-
1753
-
1754
- /* **********************************************
1755
- Begin prism-file-highlight.js
1756
- ********************************************** */
1757
-
1758
- (function () {
1759
-
1760
- if (typeof Prism === 'undefined' || typeof document === 'undefined') {
1761
- return;
1762
- }
1763
-
1764
- // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
1765
- if (!Element.prototype.matches) {
1766
- Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
1767
- }
1768
-
1769
- var LOADING_MESSAGE = 'Loading…';
1770
- var FAILURE_MESSAGE = function (status, message) {
1771
- return '✖ Error ' + status + ' while fetching file: ' + message;
1772
- };
1773
- var FAILURE_EMPTY_MESSAGE = '✖ Error: File does not exist or is empty';
1774
-
1775
- var EXTENSIONS = {
1776
- 'js': 'javascript',
1777
- 'py': 'python',
1778
- 'rb': 'ruby',
1779
- 'ps1': 'powershell',
1780
- 'psm1': 'powershell',
1781
- 'sh': 'bash',
1782
- 'bat': 'batch',
1783
- 'h': 'c',
1784
- 'tex': 'latex'
1785
- };
1786
-
1787
- var STATUS_ATTR = 'data-src-status';
1788
- var STATUS_LOADING = 'loading';
1789
- var STATUS_LOADED = 'loaded';
1790
- var STATUS_FAILED = 'failed';
1791
-
1792
- var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
1793
- + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
1794
-
1795
- /**
1796
- * Loads the given file.
1797
- *
1798
- * @param {string} src The URL or path of the source file to load.
1799
- * @param {(result: string) => void} success
1800
- * @param {(reason: string) => void} error
1801
- */
1802
- function loadFile(src, success, error) {
1803
- var xhr = new XMLHttpRequest();
1804
- xhr.open('GET', src, true);
1805
- xhr.onreadystatechange = function () {
1806
- if (xhr.readyState == 4) {
1807
- if (xhr.status < 400 && xhr.responseText) {
1808
- success(xhr.responseText);
1809
- } else {
1810
- if (xhr.status >= 400) {
1811
- error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
1812
- } else {
1813
- error(FAILURE_EMPTY_MESSAGE);
1814
- }
1815
- }
1816
- }
1817
- };
1818
- xhr.send(null);
1819
- }
1820
-
1821
- /**
1822
- * Parses the given range.
1823
- *
1824
- * This returns a range with inclusive ends.
1825
- *
1826
- * @param {string | null | undefined} range
1827
- * @returns {[number, number | undefined] | undefined}
1828
- */
1829
- function parseRange(range) {
1830
- var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
1831
- if (m) {
1832
- var start = Number(m[1]);
1833
- var comma = m[2];
1834
- var end = m[3];
1835
-
1836
- if (!comma) {
1837
- return [start, start];
1838
- }
1839
- if (!end) {
1840
- return [start, undefined];
1841
- }
1842
- return [start, Number(end)];
1843
- }
1844
- return undefined;
1845
- }
1846
-
1847
- Prism.hooks.add('before-highlightall', function (env) {
1848
- env.selector += ', ' + SELECTOR;
1849
- });
1850
-
1851
- Prism.hooks.add('before-sanity-check', function (env) {
1852
- var pre = /** @type {HTMLPreElement} */ (env.element);
1853
- if (pre.matches(SELECTOR)) {
1854
- env.code = ''; // fast-path the whole thing and go to complete
1855
-
1856
- pre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading
1857
-
1858
- // add code element with loading message
1859
- var code = pre.appendChild(document.createElement('CODE'));
1860
- code.textContent = LOADING_MESSAGE;
1861
-
1862
- var src = pre.getAttribute('data-src');
1863
-
1864
- var language = env.language;
1865
- if (language === 'none') {
1866
- // the language might be 'none' because there is no language set;
1867
- // in this case, we want to use the extension as the language
1868
- var extension = (/\.(\w+)$/.exec(src) || [, 'none'])[1];
1869
- language = EXTENSIONS[extension] || extension;
1870
- }
1871
-
1872
- // set language classes
1873
- Prism.util.setLanguage(code, language);
1874
- Prism.util.setLanguage(pre, language);
1875
-
1876
- // preload the language
1877
- var autoloader = Prism.plugins.autoloader;
1878
- if (autoloader) {
1879
- autoloader.loadLanguages(language);
1880
- }
1881
-
1882
- // load file
1883
- loadFile(
1884
- src,
1885
- function (text) {
1886
- // mark as loaded
1887
- pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
1888
-
1889
- // handle data-range
1890
- var range = parseRange(pre.getAttribute('data-range'));
1891
- if (range) {
1892
- var lines = text.split(/\r\n?|\n/g);
1893
-
1894
- // the range is one-based and inclusive on both ends
1895
- var start = range[0];
1896
- var end = range[1] == null ? lines.length : range[1];
1897
-
1898
- if (start < 0) { start += lines.length; }
1899
- start = Math.max(0, Math.min(start - 1, lines.length));
1900
- if (end < 0) { end += lines.length; }
1901
- end = Math.max(0, Math.min(end, lines.length));
1902
-
1903
- text = lines.slice(start, end).join('\n');
1904
-
1905
- // add data-start for line numbers
1906
- if (!pre.hasAttribute('data-start')) {
1907
- pre.setAttribute('data-start', String(start + 1));
1908
- }
1909
- }
1910
-
1911
- // highlight code
1912
- code.textContent = text;
1913
- Prism.highlightElement(code);
1914
- },
1915
- function (error) {
1916
- // mark as failed
1917
- pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
1918
-
1919
- code.textContent = error;
1920
- }
1921
- );
1922
- }
1923
- });
1924
-
1925
- Prism.plugins.fileHighlight = {
1926
- /**
1927
- * Executes the File Highlight plugin for all matching `pre` elements under the given container.
1928
- *
1929
- * Note: Elements which are already loaded or currently loading will not be touched by this method.
1930
- *
1931
- * @param {ParentNode} [container=document]
1932
- */
1933
- highlight: function highlight(container) {
1934
- var elements = (container || document).querySelectorAll(SELECTOR);
1935
-
1936
- for (var i = 0, element; (element = elements[i++]);) {
1937
- Prism.highlightElement(element);
1938
- }
1939
- }
1940
- };
1941
-
1942
- var logged = false;
1943
- /** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */
1944
- Prism.fileHighlight = function () {
1945
- if (!logged) {
1946
- console.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');
1947
- logged = true;
1948
- }
1949
- Prism.plugins.fileHighlight.highlight.apply(this, arguments);
1950
- };
1951
-
1952
- }());
1953
- }(prism));
1954
-
1955
- const Prism$1 = prism.exports;
1956
-
1957
- Prism.languages.python = {
1958
- 'comment': {
1959
- pattern: /(^|[^\\])#.*/,
1960
- lookbehind: true,
1961
- greedy: true
1962
- },
1963
- 'string-interpolation': {
1964
- pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
1965
- greedy: true,
1966
- inside: {
1967
- 'interpolation': {
1968
- // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
1969
- pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
1970
- lookbehind: true,
1971
- inside: {
1972
- 'format-spec': {
1973
- pattern: /(:)[^:(){}]+(?=\}$)/,
1974
- lookbehind: true
1975
- },
1976
- 'conversion-option': {
1977
- pattern: /![sra](?=[:}]$)/,
1978
- alias: 'punctuation'
1979
- },
1980
- rest: null
1981
- }
1982
- },
1983
- 'string': /[\s\S]+/
1984
- }
1985
- },
1986
- 'triple-quoted-string': {
1987
- pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
1988
- greedy: true,
1989
- alias: 'string'
1990
- },
1991
- 'string': {
1992
- pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
1993
- greedy: true
1994
- },
1995
- 'function': {
1996
- pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
1997
- lookbehind: true
1998
- },
1999
- 'class-name': {
2000
- pattern: /(\bclass\s+)\w+/i,
2001
- lookbehind: true
2002
- },
2003
- 'decorator': {
2004
- pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
2005
- lookbehind: true,
2006
- alias: ['annotation', 'punctuation'],
2007
- inside: {
2008
- 'punctuation': /\./
2009
- }
2010
- },
2011
- 'keyword': /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
2012
- 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
2013
- 'boolean': /\b(?:False|None|True)\b/,
2014
- 'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
2015
- 'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
2016
- 'punctuation': /[{}[\];(),.:]/
2017
- };
2018
-
2019
- Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
2020
-
2021
- Prism.languages.py = Prism.languages.python;
2022
-
2023
- (function (Prism) {
2024
- // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
2025
- // + LC_ALL, RANDOM, REPLY, SECONDS.
2026
- // + make sure PS1..4 are here as they are not always set,
2027
- // - some useless things.
2028
- var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b';
2029
-
2030
- var commandAfterHeredoc = {
2031
- pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
2032
- lookbehind: true,
2033
- alias: 'punctuation', // this looks reasonably well in all themes
2034
- inside: null // see below
2035
- };
2036
-
2037
- var insideString = {
2038
- 'bash': commandAfterHeredoc,
2039
- 'environment': {
2040
- pattern: RegExp('\\$' + envVars),
2041
- alias: 'constant'
2042
- },
2043
- 'variable': [
2044
- // [0]: Arithmetic Environment
2045
- {
2046
- pattern: /\$?\(\([\s\S]+?\)\)/,
2047
- greedy: true,
2048
- inside: {
2049
- // If there is a $ sign at the beginning highlight $(( and )) as variable
2050
- 'variable': [
2051
- {
2052
- pattern: /(^\$\(\([\s\S]+)\)\)/,
2053
- lookbehind: true
2054
- },
2055
- /^\$\(\(/
2056
- ],
2057
- 'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
2058
- // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
2059
- 'operator': /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
2060
- // If there is no $ sign at the beginning highlight (( and )) as punctuation
2061
- 'punctuation': /\(\(?|\)\)?|,|;/
2062
- }
2063
- },
2064
- // [1]: Command Substitution
2065
- {
2066
- pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
2067
- greedy: true,
2068
- inside: {
2069
- 'variable': /^\$\(|^`|\)$|`$/
2070
- }
2071
- },
2072
- // [2]: Brace expansion
2073
- {
2074
- pattern: /\$\{[^}]+\}/,
2075
- greedy: true,
2076
- inside: {
2077
- 'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
2078
- 'punctuation': /[\[\]]/,
2079
- 'environment': {
2080
- pattern: RegExp('(\\{)' + envVars),
2081
- lookbehind: true,
2082
- alias: 'constant'
2083
- }
2084
- }
2085
- },
2086
- /\$(?:\w+|[#?*!@$])/
2087
- ],
2088
- // Escape sequences from echo and printf's manuals, and escaped quotes.
2089
- 'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
2090
- };
2091
-
2092
- Prism.languages.bash = {
2093
- 'shebang': {
2094
- pattern: /^#!\s*\/.*/,
2095
- alias: 'important'
2096
- },
2097
- 'comment': {
2098
- pattern: /(^|[^"{\\$])#.*/,
2099
- lookbehind: true
2100
- },
2101
- 'function-name': [
2102
- // a) function foo {
2103
- // b) foo() {
2104
- // c) function foo() {
2105
- // but not “foo {”
2106
- {
2107
- // a) and c)
2108
- pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
2109
- lookbehind: true,
2110
- alias: 'function'
2111
- },
2112
- {
2113
- // b)
2114
- pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
2115
- alias: 'function'
2116
- }
2117
- ],
2118
- // Highlight variable names as variables in for and select beginnings.
2119
- 'for-or-select': {
2120
- pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
2121
- alias: 'variable',
2122
- lookbehind: true
2123
- },
2124
- // Highlight variable names as variables in the left-hand part
2125
- // of assignments (“=” and “+=”).
2126
- 'assign-left': {
2127
- pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
2128
- inside: {
2129
- 'environment': {
2130
- pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars),
2131
- lookbehind: true,
2132
- alias: 'constant'
2133
- }
2134
- },
2135
- alias: 'variable',
2136
- lookbehind: true
2137
- },
2138
- // Highlight parameter names as variables
2139
- 'parameter': {
2140
- pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
2141
- alias: 'variable',
2142
- lookbehind: true
2143
- },
2144
- 'string': [
2145
- // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
2146
- {
2147
- pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
2148
- lookbehind: true,
2149
- greedy: true,
2150
- inside: insideString
2151
- },
2152
- // Here-document with quotes around the tag
2153
- // → No expansion (so no “inside”).
2154
- {
2155
- pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
2156
- lookbehind: true,
2157
- greedy: true,
2158
- inside: {
2159
- 'bash': commandAfterHeredoc
2160
- }
2161
- },
2162
- // “Normal” string
2163
- {
2164
- // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
2165
- pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
2166
- lookbehind: true,
2167
- greedy: true,
2168
- inside: insideString
2169
- },
2170
- {
2171
- // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
2172
- pattern: /(^|[^$\\])'[^']*'/,
2173
- lookbehind: true,
2174
- greedy: true
2175
- },
2176
- {
2177
- // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
2178
- pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
2179
- greedy: true,
2180
- inside: {
2181
- 'entity': insideString.entity
2182
- }
2183
- }
2184
- ],
2185
- 'environment': {
2186
- pattern: RegExp('\\$?' + envVars),
2187
- alias: 'constant'
2188
- },
2189
- 'variable': insideString.variable,
2190
- 'function': {
2191
- pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
2192
- lookbehind: true
2193
- },
2194
- 'keyword': {
2195
- pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
2196
- lookbehind: true
2197
- },
2198
- // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
2199
- 'builtin': {
2200
- pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
2201
- lookbehind: true,
2202
- // Alias added to make those easier to distinguish from strings.
2203
- alias: 'class-name'
2204
- },
2205
- 'boolean': {
2206
- pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
2207
- lookbehind: true
2208
- },
2209
- 'file-descriptor': {
2210
- pattern: /\B&\d\b/,
2211
- alias: 'important'
2212
- },
2213
- 'operator': {
2214
- // Lots of redirections here, but not just that.
2215
- pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
2216
- inside: {
2217
- 'file-descriptor': {
2218
- pattern: /^\d/,
2219
- alias: 'important'
2220
- }
2221
- }
2222
- },
2223
- 'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
2224
- 'number': {
2225
- pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
2226
- lookbehind: true
2227
- }
2228
- };
2229
-
2230
- commandAfterHeredoc.inside = Prism.languages.bash;
2231
-
2232
- /* Patterns in command substitution. */
2233
- var toBeCopied = [
2234
- 'comment',
2235
- 'function-name',
2236
- 'for-or-select',
2237
- 'assign-left',
2238
- 'parameter',
2239
- 'string',
2240
- 'environment',
2241
- 'function',
2242
- 'keyword',
2243
- 'builtin',
2244
- 'boolean',
2245
- 'file-descriptor',
2246
- 'operator',
2247
- 'punctuation',
2248
- 'number'
2249
- ];
2250
- var inside = insideString.variable[1].inside;
2251
- for (var i = 0; i < toBeCopied.length; i++) {
2252
- inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];
2253
- }
2254
-
2255
- Prism.languages.sh = Prism.languages.bash;
2256
- Prism.languages.shell = Prism.languages.bash;
2257
- }(Prism));
2258
-
2259
- (function (Prism) {
2260
-
2261
- // https://yaml.org/spec/1.2/spec.html#c-ns-anchor-property
2262
- // https://yaml.org/spec/1.2/spec.html#c-ns-alias-node
2263
- var anchorOrAlias = /[*&][^\s[\]{},]+/;
2264
- // https://yaml.org/spec/1.2/spec.html#c-ns-tag-property
2265
- var tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
2266
- // https://yaml.org/spec/1.2/spec.html#c-ns-properties(n,c)
2267
- var properties = '(?:' + tag.source + '(?:[ \t]+' + anchorOrAlias.source + ')?|'
2268
- + anchorOrAlias.source + '(?:[ \t]+' + tag.source + ')?)';
2269
- // https://yaml.org/spec/1.2/spec.html#ns-plain(n,c)
2270
- // This is a simplified version that doesn't support "#" and multiline keys
2271
- // All these long scarry character classes are simplified versions of YAML's characters
2272
- var plainKey = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source
2273
- .replace(/<PLAIN>/g, function () { return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source; });
2274
- var string = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
2275
-
2276
- /**
2277
- *
2278
- * @param {string} value
2279
- * @param {string} [flags]
2280
- * @returns {RegExp}
2281
- */
2282
- function createValuePattern(value, flags) {
2283
- flags = (flags || '').replace(/m/g, '') + 'm'; // add m flag
2284
- var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source
2285
- .replace(/<<prop>>/g, function () { return properties; }).replace(/<<value>>/g, function () { return value; });
2286
- return RegExp(pattern, flags);
2287
- }
2288
-
2289
- Prism.languages.yaml = {
2290
- 'scalar': {
2291
- pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source
2292
- .replace(/<<prop>>/g, function () { return properties; })),
2293
- lookbehind: true,
2294
- alias: 'string'
2295
- },
2296
- 'comment': /#.*/,
2297
- 'key': {
2298
- pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source
2299
- .replace(/<<prop>>/g, function () { return properties; })
2300
- .replace(/<<key>>/g, function () { return '(?:' + plainKey + '|' + string + ')'; })),
2301
- lookbehind: true,
2302
- greedy: true,
2303
- alias: 'atrule'
2304
- },
2305
- 'directive': {
2306
- pattern: /(^[ \t]*)%.+/m,
2307
- lookbehind: true,
2308
- alias: 'important'
2309
- },
2310
- 'datetime': {
2311
- pattern: createValuePattern(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
2312
- lookbehind: true,
2313
- alias: 'number'
2314
- },
2315
- 'boolean': {
2316
- pattern: createValuePattern(/false|true/.source, 'i'),
2317
- lookbehind: true,
2318
- alias: 'important'
2319
- },
2320
- 'null': {
2321
- pattern: createValuePattern(/null|~/.source, 'i'),
2322
- lookbehind: true,
2323
- alias: 'important'
2324
- },
2325
- 'string': {
2326
- pattern: createValuePattern(string),
2327
- lookbehind: true,
2328
- greedy: true
2329
- },
2330
- 'number': {
2331
- pattern: createValuePattern(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, 'i'),
2332
- lookbehind: true
2333
- },
2334
- 'tag': tag,
2335
- 'important': anchorOrAlias,
2336
- 'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./
2337
- };
2338
-
2339
- Prism.languages.yml = Prism.languages.yaml;
2340
-
2341
- }(Prism));
2342
-
2343
- (function (Prism) {
2344
-
2345
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
2346
-
2347
- Prism.languages.css = {
2348
- 'comment': /\/\*[\s\S]*?\*\//,
2349
- 'atrule': {
2350
- pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
2351
- inside: {
2352
- 'rule': /^@[\w-]+/,
2353
- 'selector-function-argument': {
2354
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
2355
- lookbehind: true,
2356
- alias: 'selector'
2357
- },
2358
- 'keyword': {
2359
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
2360
- lookbehind: true
2361
- }
2362
- // See rest below
2363
- }
2364
- },
2365
- 'url': {
2366
- // https://drafts.csswg.org/css-values-3/#urls
2367
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
2368
- greedy: true,
2369
- inside: {
2370
- 'function': /^url/i,
2371
- 'punctuation': /^\(|\)$/,
2372
- 'string': {
2373
- pattern: RegExp('^' + string.source + '$'),
2374
- alias: 'url'
2375
- }
2376
- }
2377
- },
2378
- 'selector': {
2379
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
2380
- lookbehind: true
2381
- },
2382
- 'string': {
2383
- pattern: string,
2384
- greedy: true
2385
- },
2386
- 'property': {
2387
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
2388
- lookbehind: true
2389
- },
2390
- 'important': /!important\b/i,
2391
- 'function': {
2392
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
2393
- lookbehind: true
2394
- },
2395
- 'punctuation': /[(){};:,]/
2396
- };
2397
-
2398
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
2399
-
2400
- var markup = Prism.languages.markup;
2401
- if (markup) {
2402
- markup.tag.addInlined('style', 'css');
2403
- markup.tag.addAttribute('style', 'css');
2404
- }
2405
-
2406
- }(Prism));
2407
-
2408
- const edsCodeBlockCss = ":host{display:block;font-family:var(--font-family, 'Courier New', monospace)}pre[class*=\"language-\"]{white-space:pre-wrap;word-break:break-word;}.language{font-weight:bold;text-transform:uppercase}pre{margin:0;border-radius:8px;color:var(--purple-200);overflow:auto}code{font-family:'Courier New', monospace}.token.keyword{color:var(--purple-500)}.token.string{color:var(--green-500)}.token.function{color:var(--cyan-500)}.token.comment{color:var(--grey-700)}.relative{position:relative}.bg-stronger{background-color:var(--grey-900)}.rounded-sm{border-radius:8px}.rounded-xs{border-radius:4px}.text-inverse{color:var(--white)}.text-light{color:var(--grey-700)}.text-lighter{color:var(--grey-600)}.text-lightest{color:var(--grey-500)}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.p-0{padding:0rem}.p-12{padding:0.75rem}.p-16{padding:1rem}.p-20{padding:1.25rem}.p-6{padding:0.375rem}.p-8{padding:0.5rem}.pl-8{padding-left:0.5rem}.mb-10{margin-bottom:0.625rem}.mb-12{margin-bottom:0.75rem}.mb-28{margin-bottom:1.75rem}.pb-16{padding-bottom:1rem}.pb-20{padding-bottom:1.25rem}.pb-28{padding-bottom:1.75rem}.pb-60{padding-bottom:3.75rem}.pb-8{padding-bottom:0.5rem}.mt-16{margin-top:1rem}.mt-2{margin-top:0.125rem}.mt-20{margin-top:1.25rem}.mt-28{margin-top:1.75rem}.w-20{width:1.25rem}.h-20{height:1.25rem}.f-ui-03{font-family:var(--f-ui-03-fontFamily);font-weight:var(--f-ui-03-fontWeight);font-size:var(--f-ui-03-fontSize);line-height:var(--f-ui-03-lineHeight);letter-spacing:var(--f-ui-03-letterSpacing)}.f-ui-03-light{font-family:var(--f-ui-03-light-fontFamily);font-weight:var(--f-ui-03-light-fontWeight);font-size:var(--f-ui-03-light-fontSize);line-height:var(--f-ui-03-light-lineHeight);letter-spacing:var(--f-ui-03-light-letterSpacing)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}";
2409
- const EdsCodeBlockStyle0 = edsCodeBlockCss;
2410
-
2411
- const EdsCodeBlock = class {
2412
- constructor(hostRef) {
2413
- registerInstance(this, hostRef);
2414
- this.code = undefined;
2415
- this.language = undefined;
2416
- this.copied = false;
2417
- }
2418
- /**
2419
- * Copies the current code content to the clipboard and sets a temporary copied state.
2420
- *
2421
- * @private
2422
- * @returns {void}
2423
- */
2424
- copyToClipboard() {
2425
- navigator.clipboard.writeText(this.code).then(() => {
2426
- this.copied = true;
2427
- /*const analyticsName = this.createHumanFriendlyAnalyticsName(this.code, this.language);
2428
- sendAnalytics({
2429
- category: 'ui-component',
2430
- parentContext: null,
2431
- tag: this.el.tagName.toLowerCase(),
2432
- name: analyticsName || '',
2433
- action: 'copy'
2434
- });*/
2435
- setTimeout(() => (this.copied = false), 2000);
2436
- });
2437
- }
2438
- /**
2439
- * Utility function that creates a human-friendly analytics name based on the code and language.
2440
- * It uses:
2441
- * - The language (in uppercase)
2442
- * - The number of non-empty lines in the code
2443
- * - The first non-empty line of code (truncated to 30 characters, if needed)
2444
- *
2445
- * returns A descriptive analytics name.
2446
- */
2447
- /*private createHumanFriendlyAnalyticsName(code: string, language: string): string {
2448
- // Count non-empty lines
2449
- const lines = code.split('\n').filter(line => line.trim() !== '').length;
2450
-
2451
- // Find the first non-empty line and trim it
2452
- let firstNonEmptyLine = code.split('\n').find(line => line.trim() !== '');
2453
- firstNonEmptyLine = firstNonEmptyLine ? firstNonEmptyLine.trim() : '';
2454
-
2455
- // Truncate the snippet if it’s too long
2456
- if (firstNonEmptyLine.length > 30) {
2457
- firstNonEmptyLine = firstNonEmptyLine.substring(0, 30) + '...';
2458
- }
2459
-
2460
- return `CodeBlock:${language.toLowerCase()}|${lines}-line(s)|${firstNonEmptyLine.toLowerCase()}`;
2461
- }*/
2462
- /**
2463
- * Returns the syntax-highlighted HTML for the code.
2464
- * If the provided language is supported by Prism, this method returns the highlighted code.
2465
- * Otherwise, it logs a warning and returns the raw code.
2466
- *
2467
- * @private
2468
- * @returns {string} The highlighted HTML string for the code block.
2469
- */
2470
- getHighlightedCode() {
2471
- if (this.language && Prism$1.languages[this.language]) {
2472
- return Prism$1.highlight(this.code, Prism$1.languages[this.language], this.language);
2473
- }
2474
- // eslint-disable-next-line
2475
- //console.warn(`Unsupported or missing language: ${this.language}`);
2476
- return this.code; // Fallback if language is not provided or unsupported
2477
- }
2478
- render() {
2479
- return (h("div", { key: '7550f1c5e29a9be39614404d51dfec9a7aa194a9', class: "relative bg-stronger rounded-sm" }, h("div", { key: '8e654051ec6105e051af723e056b4151afc4305c', class: "text-inverse flex justify-between items-center p-8" }, this.language ? (h("span", { class: "f-ui-03" }, this.language.toUpperCase())) : (h("pre", { class: "bg-stronger pl-8", role: "region", "aria-label": "Code block without language" }, h("code", { innerHTML: this.getHighlightedCode() }))), h("span", { key: '1f558301727adb451524850b352844d7658f33a8', "aria-hidden": "true", class: "w-20 h-20 mt-8" }, h("eds-icon-wrapper", { key: '7def1f38f949c32d6138d88a0a7edf9655852491', icon: this.copied ? 'success' : 'copy', onClick: () => this.copyToClipboard() })), h("span", { key: '9eabcd54f3bcdc1c4627a7ca7e22fd38e9755ca6', class: "sr-only" }, "Copy Code")), this.language && (h("pre", { key: 'd15dce4b1692bf1956e1b3cb3586dde4d9561f1b', class: `language-${this.language} bg-stronger pl-8 pb-8`, role: "region", "aria-label": `Code block in ${this.language}` }, h("code", { key: 'ad7eb7b40aaab69b6bc929c632ce4736fe3c39a5', innerHTML: this.getHighlightedCode() })))));
2480
- }
2481
- get el() { return getElement(this); }
2482
- };
2483
- EdsCodeBlock.style = EdsCodeBlockStyle0;
2484
-
2485
- export { EdsCodeBlock as eds_code_block };